diff --git a/src/accept.c b/src/accept.c index d86aba6..8948cef 100644 --- a/src/accept.c +++ b/src/accept.c @@ -580,7 +580,7 @@ static void peerip_clients_config(void) c->state = CSTATE_COREPEER; c->validated = VALIDATED_WEAK; c->flags = CLFLAGS_UPLINKPORT; - c->handler = &incoming_handler; + c->handler_line_in = &incoming_handler; memcpy((void *)&c->udpaddr.sa, (void *)pe->ai->ai_addr, pe->ai->ai_addrlen); c->udpaddrlen = pe->ai->ai_addrlen; c->udp_port = pe->remote_port; // remote port @@ -1131,7 +1131,7 @@ static void do_accept(struct listen_t *l) c->state = CSTATE_LOGIN; /* use the default login handler */ - c->handler = &login_handler; + c->handler_line_in = &login_handler; c->keepalive = tick; /* monotonous time, for timed transmits */ #ifdef USE_SSL @@ -1333,13 +1333,13 @@ static int accept_liveupgrade_single(cJSON *client, int *rxerr_map, int rxerr_ma if (strcmp(state->valuestring, "connected") == 0) { c->state = CSTATE_CONNECTED; - c->handler = &incoming_handler; + c->handler_line_in = &incoming_handler; strncpy(c->username, username->valuestring, sizeof(c->username)); c->username[sizeof(c->username)-1] = 0; c->username_len = strlen(c->username); } else if (strcmp(state->valuestring, "login") == 0) { c->state = CSTATE_LOGIN; - c->handler = &login_handler; + c->handler_line_in = &login_handler; } else { hlog(LOG_ERR, "Live upgrade: Client %s is in invalid state '%s' (fd %d)", l->addr_s, state->valuestring, l->fd); goto err; diff --git a/src/login.c b/src/login.c index 712e6db..bb42a14 100644 --- a/src/login.c +++ b/src/login.c @@ -392,7 +392,7 @@ int login_handler(struct worker_t *self, struct client_t *c, int l4proto, char * sanitize_ascii_string(c->filter_s); /* ok, login succeeded, switch handler */ - c->handler = &incoming_handler; /* handler of all incoming APRS-IS data during a connection */ + c->handler_line_in = &incoming_handler; /* handler of all incoming APRS-IS data during a connection */ rc = client_printf( self, c, "# logresp %s %s, server %s\r\n", username, diff --git a/src/uplink.c b/src/uplink.c index 6cd8a2e..6021d24 100644 --- a/src/uplink.c +++ b/src/uplink.c @@ -227,7 +227,7 @@ int uplink_logresp_handler(struct worker_t *self, struct client_t *c, int l4prot hlog(LOG_INFO, "%s: Uplink logged in to server %s", c->addr_rem, c->username); - c->handler = incoming_handler; + c->handler_line_in = incoming_handler; /* mark as connected and classify */ worker_mark_client_connected(self, c); @@ -287,7 +287,7 @@ int uplink_login_handler(struct worker_t *self, struct client_t *c, int l4proto, rc = client_write(self, c, buf, len); if (rc < -2) return rc; // the client was destroyed by client_write, don't touch it - c->handler = uplink_logresp_handler; + c->handler_line_in = uplink_logresp_handler; c->state = CSTATE_LOGRESP; hlog(LOG_INFO, "%s: Connected to server, logging in", c->addr_rem); @@ -565,7 +565,7 @@ connerr: c->ai_protocol = req.ai_protocol; c->state = CSTATE_INIT; /* use the default login handler */ - c->handler = & uplink_login_handler; + c->handler_line_in = &uplink_login_handler; c->flags = l->client_flags; c->keepalive = tick; c->last_read = tick; diff --git a/src/worker.c b/src/worker.c index 41fc95e..0e609e7 100644 --- a/src/worker.c +++ b/src/worker.c @@ -1094,7 +1094,7 @@ static int handle_corepeer_readable(struct worker_t *self, struct client_t *c) } } - c->handler(self, rc, IPPROTO_UDP, c->ibuf, r); + c->handler_line_in(self, rc, IPPROTO_UDP, c->ibuf, r); return 0; } @@ -1136,7 +1136,7 @@ int client_postread(struct worker_t *self, struct client_t *c, int r) // *s = ch; /* NOTE: handler call CAN destroy the c-> object ! */ - if (c->handler(self, c, IPPROTO_TCP, row_start, s - row_start) < 0) + if (c->handler_line_in(self, c, IPPROTO_TCP, row_start, s - row_start) < 0) return -1; } /* skip the first, just-found part of EOL, which might have been diff --git a/src/worker.h b/src/worker.h index 16dd479..f78bf80 100644 --- a/src/worker.h +++ b/src/worker.h @@ -354,7 +354,7 @@ struct client_t { char quirks_mode; /* is this a known buggy-and-unmaintained application on our blacklist */ /* the current handler function for incoming lines */ - int (*handler) (struct worker_t *self, struct client_t *c, int l4proto, char *s, int len); + int (*handler_line_in) (struct worker_t *self, struct client_t *c, int l4proto, char *s, int len); /* outbound filter chain head */ struct filter_t *posdefaultfilters; diff --git a/tests/t/11misc-drops.t b/tests/t/11misc-drops.t index 6178bd2..64f5820 100644 --- a/tests/t/11misc-drops.t +++ b/tests/t/11misc-drops.t @@ -79,6 +79,7 @@ my @pkts = ( "SRC2>DST,DIGI,TCPXX*,qAR,$login:>Packet from unverified login according to TCPXX* in path", "SRC->DST,DIGI-0,qAR,$login:>should drop, too short SSID in srccall", "SRC-111>DST,DIGI-0,qAR,$login:>should drop, too long SSID in srccall", + "EL-DH5FFL>DST,DIGI-0,qAR,$login:>should drop, much too long SSID in srccall", "SRC>DST,DIGI-0,qAR,$login:>should drop, -0 SSID in viacall", );