diff --git a/src/incoming.c b/src/incoming.c index 5a9ae0b..bb2330f 100644 --- a/src/incoming.c +++ b/src/incoming.c @@ -77,7 +77,8 @@ const char *inerr_labels[] = { "q_nonval_multi_q_calls", "q_i_no_viacall", "inerr_empty", - "dis_srccall" + "disallow_srccall", + "disallow_dx" }; #define incoming_strerror(i) ((i <= 0 && i >= INERR_MIN) ? inerr_labels[i * -1] : inerr_labels[0]) diff --git a/src/parse_aprs.c b/src/parse_aprs.c index 9d41314..5508dab 100644 --- a/src/parse_aprs.c +++ b/src/parse_aprs.c @@ -1216,6 +1216,12 @@ static int parse_aprs_body(struct pbuf_t *pb, const char *info_start) return parse_aprs_item(pb, body, body_end); } return 0; + + case 'D': + /* we drop DX beacon packets, they start with "DX de " */ + if (strncmp(body, "X de ", 5) == 0) + return INERR_DIS_DX; + break; case 'T': if (body_end - body > 18) { diff --git a/src/web/aprsc.js b/src/web/aprsc.js index 3c246b8..700562e 100644 --- a/src/web/aprsc.js +++ b/src/web/aprsc.js @@ -219,7 +219,9 @@ var rx_err_strings = { "q_newq_buffer_small": 'New Q construct too big', "q_nonval_multi_q_calls": 'Multiple callsigns in Q path from unverified client', "q_i_no_viacall": 'I path has no viacall', - "inerr_empty": 'Empty packet' + "inerr_empty": 'Empty packet', + "disallow_srcall": 'Disallowed source callsign (N0CALL or such)', + "disallow_dx": 'DX beacon packet' }; var key_translate = { diff --git a/src/worker.h b/src/worker.h index 4fc52b3..388d3b4 100644 --- a/src/worker.h +++ b/src/worker.h @@ -219,8 +219,9 @@ struct client_heard_t { #define INERR_Q_I_NO_VIACALL -30 #define INERR_EMPTY -31 #define INERR_DIS_SRCCALL -32 +#define INERR_DIS_DX -33 -#define INERR_MIN -32 /* MINIMUM VALUE FOR INERR, GROW WHEN NEEDED! */ +#define INERR_MIN -33 /* MINIMUM VALUE FOR INERR, GROW WHEN NEEDED! */ /* WHEN ADDING STUFF HERE, REMEMBER TO UPDATE inerr_labels IN incoming.c. Thanks! */ #define INERR_BUCKETS (INERR_MIN*-1 + 1) diff --git a/tests/t/11misc-drops.t b/tests/t/11misc-drops.t index ac378d0..0332524 100644 --- a/tests/t/11misc-drops.t +++ b/tests/t/11misc-drops.t @@ -85,6 +85,8 @@ my @pkts = ( "N0CALL>DST,DIGI,qAR,$login:>should drop, N0CALL as source callsign", "NOCALL>DST,DIGI,qAR,$login:>should drop, NOCALL as source callsign", "SERVER>DST,DIGI,qAR,$login:>should drop, SERVER as source callsign", + # DX spots + "SRC>DST,DIGI,qAR,$login:DX de FOO: BAR - should drop", ); # send the packets