Compare commits

...

3 Commits

Author SHA1 Message Date
ua1zbe 96ea2f9079 Загрузил(а) файлы в '' 2023-02-04 13:15:05 +03:00
Heikki Hannikainen 5e22b37c57 v2.1.14 2023-01-27 19:27:11 +02:00
Heikki Hannikainen c11122c2b0 no_tx: Do not send packets to broken TX igates.
Blacklist an igate software implementation which does not use the 3rd party
packet format when forwarding packets from APRS-IS to RF.  It causes loops
and confuses all other igates around to think that all those stations on
APRS-IS are reachable locally on RF.
2023-01-27 19:03:27 +02:00
6 changed files with 27 additions and 5 deletions

BIN
aprsc-latest.tar.gz Normal file

Binary file not shown.

View File

@ -1 +1 @@
2.1.13
2.1.14

View File

@ -42,6 +42,13 @@ static const char *quirks_mode_blacklist[] = {
NULL
};
/* known-broken applications which do not implement TX igate properly, do not pass packets downstream
*/
static const char *igate_tx_blacklist[] = {
"GW1000", /* Does not transmit 3rd party format on RF */
NULL
};
/*
* Parse the login string in a HTTP POST or UDP submit packet
* Argh, why are these not in standard POST parameters in HTTP?
@ -163,8 +170,17 @@ void login_set_app_name(struct client_t *c, const char *app_name, const char *ap
strncpy(c->app_version, app_ver, sizeof(c->app_version));
c->app_version[sizeof(c->app_version)-1] = 0;
sanitize_ascii_string(c->app_version);
/* check the application name against a static list of broken apps */
for (i = 0; (igate_tx_blacklist[i]); i++) {
if (prefixmatch(c->app_name, igate_tx_blacklist[i])) {
hlog(LOG_INFO, "%s/%s: Not transmitting packets to broken TX igate: %s %s",
c->addr_rem, c->username, c->app_name, c->app_version);
c->no_tx = 1;
break;
}
}
if (quirks_mode) {
c->quirks_mode = 1;
return;
@ -173,13 +189,12 @@ void login_set_app_name(struct client_t *c, const char *app_name, const char *ap
c->quirks_mode = 0;
for (i = 0; (quirks_mode_blacklist[i]); i++) {
if (prefixmatch(c->app_name, quirks_mode_blacklist[i])) {
hlog(LOG_DEBUG, "%s/%s: Enabling quirks mode for application %s %s",
hlog(LOG_DEBUG, "%s/%s: Enabling quirks mode for application: %s %s",
c->addr_rem, c->username, c->app_name, c->app_version);
c->quirks_mode = 1;
break;
}
}
}
int login_setup_udp_feed(struct client_t *c, int port)
@ -431,7 +446,7 @@ int login_handler(struct worker_t *self, struct client_t *c, int l4proto, char *
/* ok, login succeeded, switch handler */
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,
(c->validated) ? "verified" : "unverified",

View File

@ -120,6 +120,10 @@ static void process_outgoing_single(struct worker_t *self, struct pbuf_t *pb)
//hlog(LOG_DEBUG, "%d: not sending to client: originated from this socketsocket", c->fd);
continue;
}
/* Do not send packets to clients which we've blacklisted as broken. */
if (c->no_tx)
continue;
send_single(self, c, pb->data, pb->packet_len);
}

View File

@ -2213,6 +2213,8 @@ static struct cJSON *worker_client_json(struct client_t *c, int liveup_info)
if (c->quirks_mode)
cJSON_AddNumberToObject(jc, "quirks_mode", c->quirks_mode);
if (c->no_tx)
cJSON_AddNumberToObject(jc, "no_tx", c->no_tx);
json_add_rxerrs(jc, "rx_errs", c->localaccount.rxerrs);

View File

@ -355,6 +355,7 @@ struct client_t {
char hidden; /* is the user on a hidden listener socket, not shown on status */
char failed_cmds; /* how many login commands have failed */
char quirks_mode; /* is this a known buggy-and-unmaintained application on our blacklist */
char no_tx; /* is the TX igate implementation broken and on our blacklist */
char loc_known; /* have we received a position packet from this client */
/* the current handler function for incoming lines */