summaryrefslogtreecommitdiffstats
path: root/axconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'axconfig.c')
-rw-r--r--axconfig.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/axconfig.c b/axconfig.c
index ceb8490..e3505d3 100644
--- a/axconfig.c
+++ b/axconfig.c
@@ -195,7 +195,6 @@ static int ax25_config_init_port(int fd, int lineno, char *line, const char **if
char *name, *call, *baud, *paclen, *window, *desc;
const char *dev = NULL;
int found;
- char call_beautified[10]; /* DL9SAU-10\0 */
name = strtok(line, " \t");
call = strtok(NULL, " \t");
@@ -237,26 +236,18 @@ static int ax25_config_init_port(int fd, int lineno, char *line, const char **if
}
strupr(call);
- /* user may have configured "DL9SAU". But we compare to *ifcalls,
- * which comes from ifr_hwaddr.sa_data and it always contains a SSID;
- * in this case, "DL9SAU-0". This fixes a bug introduced 2008-04-02,
- * which caused interfaces without SSID not being found anymore. :(
- */
- strncpy(call_beautified, call, sizeof(call_beautified)-1);
- call_beautified[sizeof(call_beautified)-1] = 0;
- if (strchr(call_beautified, '-') == NULL && strlen(call_beautified) < 7)
- strcat(call_beautified, "-0");
-
found = 0;
+ char *cp;
+ if ((cp = strstr(call, "-0")) != NULL)
+ *cp = '\0';
for (;ifcalls && *ifcalls; ++ifcalls, ++ifdevs) {
- if (strcmp(call_beautified, *ifcalls) == 0) {
+ if (strcmp(call, *ifcalls) == 0) {
found = 1;
dev = *ifdevs;
break;
}
}
-
if (!found) {
#if 0 /* None of your business to complain about some port being down... */
fprintf(stderr, "axconfig: port with call '%s' is not active\n", call);
@@ -270,7 +261,7 @@ static int ax25_config_init_port(int fd, int lineno, char *line, const char **if
}
p->Name = strdup(name);
- p->Call = strdup(call_beautified);
+ p->Call = strdup(call);
p->Device = strdup(dev);
p->Baud = atoi(baud);
p->Window = atoi(window);