From 2fc95e7e1c86eca82a83d558baf400faa5a94590 Mon Sep 17 00:00:00 2001 From: Heikki Hannikainen Date: Fri, 28 Jun 2013 08:10:50 +0300 Subject: [PATCH] IS2: Use explicit IS2 config for uplink setup --- src/aprsis2.c | 2 +- src/config.c | 4 +++- src/uplink.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/aprsis2.c b/src/aprsis2.c index 38bc92f..72c9962 100644 --- a/src/aprsis2.c +++ b/src/aprsis2.c @@ -49,7 +49,7 @@ int is2_out_server_signature(struct worker_t *self, struct client_t *c) buf = is2_allocate_buffer(len); is2_message__pack(&m, buf + IS2_HEAD_LEN); - c->write(self, c, "#IS2\n", 5); + //c->write(self, c, "#IS2\n", 5); /* not a good idea after all */ c->write(self, c, buf, len + IS2_HEAD_LEN + IS2_TAIL_LEN); hfree(buf); diff --git a/src/config.c b/src/config.c index 1e2045b..33cc57e 100644 --- a/src/config.c +++ b/src/config.c @@ -768,7 +768,9 @@ int do_uplink(struct uplink_config_t **lq, int argc, char **argv) l->state = UPLINK_ST_UNKNOWN; for (i = 6; i < argc; i++) { - if (strcasecmp(argv[i], "tlskey") == 0 || strcasecmp(argv[i], "sslkey") == 0) { + if (strcasecmp(argv[i], "is2") == 0) { + l->client_flags |= CLFLAGS_IS2; + } else if (strcasecmp(argv[i], "tlskey") == 0 || strcasecmp(argv[i], "sslkey") == 0) { if (config_uplink_tls(argv, argc, &i, "tlskey", (char **)&l->keyfile)) { free_uplink_config(&l); return -2; diff --git a/src/uplink.c b/src/uplink.c index feb4ca4..553c8dc 100644 --- a/src/uplink.c +++ b/src/uplink.c @@ -312,11 +312,13 @@ int uplink_login_handler(struct worker_t *self, struct client_t *c, int l4proto, } #endif + /* Might not be a good idea after all. if (len >= 4 && memcmp(s, "#IS2", 4) == 0) { hlog_packet(LOG_INFO, s, len, "%s: Uplink server talks IS2, switching: ", c->addr_rem); c->handler_consume_input = &is2_deframe_input; return 0; } + */ hlog_packet(LOG_INFO, s, len, "%s: Uplink server software: ", c->addr_rem);