Skip to content

Commit 095a2cd

Browse files
committed
Raise config syntax error for N0CALL/NOCALL
Check to see if the user tries to start APRX with one of the two placeholder callsigns and error out if they do instead of trying to DDoS the APRS-IS servers Closes #64
1 parent 74fce30 commit 095a2cd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

config.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ char *config_SKIPSPACE(char *Y) {
2222
return Y;
2323
}
2424

25+
// Validate the callsign configured for APRX
26+
// Ensure that it meets the requirements for an APRS callsign
27+
// and if it is also a valid AX.25 callsign if strict is true.
28+
//
2529
// return 0 for failures, 1 for OK.
2630
int validate_callsign_input(char *callsign, int strict) {
2731
int i = strlen(callsign);
@@ -82,6 +86,15 @@ int validate_callsign_input(char *callsign, int strict) {
8286
callsign[i - 2] = 0;
8387
/* If tailed with "-0" SSID, chop it off.. */
8488
}
89+
90+
// Check for invalid default callsigns
91+
if (strncmp(callsign, "N0CALL", 6) == 0) {
92+
return 0;
93+
}
94+
if (strncmp(callsign, "NOCALL", 6) == 0) {
95+
return 0;
96+
}
97+
8598
return 1;
8699
}
87100

0 commit comments

Comments
 (0)