Compare commits

...

5 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
Heikki Hannikainen 79b6c3eb0f v2.1.13 2022-11-02 01:09:12 +02:00
Heikki Hannikainen 17dce48cd0 uplink: Fix building on older GCC 2022-11-01 23:08:03 +00:00
7 changed files with 32 additions and 8 deletions

BIN
aprsc-latest.tar.gz Normal file

Binary file not shown.

View File

@ -1 +1 @@
2.1.12
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?
@ -165,6 +172,15 @@ void login_set_app_name(struct client_t *c, const char *app_name, const char *ap
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)

View File

@ -121,6 +121,10 @@ static void process_outgoing_single(struct worker_t *self, struct pbuf_t *pb)
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

@ -123,7 +123,8 @@ void close_uplinkers(void)
return;
}
for (struct uplink_client_t *uc = uplink_clients; (uc); uc = uc->next) {
struct uplink_client_t *uc;
for (uc = uplink_clients; (uc); uc = uc->next) {
if (uc->client && uc->client->fd >= 0) {
hlog( LOG_DEBUG, "Closing uplinking socket (fd %d) %s ...", uc->client->fd, uc->client->addr_rem );
shutdown(uc->client->fd, SHUT_RDWR);
@ -167,7 +168,8 @@ void uplink_close(struct client_t *c, int errnum)
}
}
for (struct uplink_client_t *uc = uplink_clients; (uc); uc = uc->next) {
struct uplink_client_t *uc;
for (uc = uplink_clients; (uc); uc = uc->next) {
if (uc->client == c) {
uplink_client_free(uc);
break;

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 */