Skip to content

Commit 30a904e

Browse files
committed
All filter inspect 63rd party paylof #428
1 parent 8587496 commit 30a904e

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

Diff for: src/pfilter.c

+15-13
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ int pfilter (int from_chan, int to_chan, char *filter, packet_t pp, int is_aprs)
200200
pfstate_t pfstate;
201201
char *p;
202202
int result;
203+
char * infop = NULL;
204+
203205

204206
assert (from_chan >= 0 && from_chan <= MAX_CHANS);
205207
assert (to_chan >= 0 && to_chan <= MAX_CHANS);
@@ -231,6 +233,19 @@ int pfilter (int from_chan, int to_chan, char *filter, packet_t pp, int is_aprs)
231233
}
232234
}
233235

236+
(void) ax25_get_info (pp, (unsigned char **)(&infop));
237+
assert (infop != NULL);
238+
if (*infop == '}') {
239+
// We have a 3d party packet, dig inside it to get the actual type.
240+
packet_t pp_payload = ax25_from_text ((char*)infop+1, 0);
241+
if (pp_payload == NULL) {
242+
print_error (&pfstate, "Invalid third party payload\n");
243+
return (0);
244+
}
245+
246+
return pfilter(from_chan, to_chan, filter, pp_payload, is_aprs);
247+
}
248+
234249
pfstate.pp = pp;
235250
pfstate.is_aprs = is_aprs;
236251

@@ -869,19 +884,6 @@ static int filt_t (pfstate_t *pf)
869884

870885
assert (infop != NULL);
871886

872-
if(*infop == '}') {
873-
// We have a 3d party packet, dig inside it to get the actual type.
874-
packet_t pp_payload = ax25_from_text ((char*)infop+1, 0);
875-
if (pp_payload == NULL) {
876-
print_error (pf, "Invalid third party payload\n");
877-
return (0);
878-
}
879-
memset (src, 0, sizeof(src));
880-
ax25_get_addr_with_ssid (pp_payload, AX25_SOURCE, src);
881-
(void) ax25_get_info (pp_payload, (unsigned char **)(&infop));
882-
ax25_delete(pp_payload);
883-
}
884-
885887
for (f = pf->token_str + 2; *f != '\0'; f++) {
886888
switch (*f) {
887889

0 commit comments

Comments
 (0)