X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprotocol_auth.c;h=d98e5c4b1a314f0324c80a786e01260fbe5058c2;hb=86d83bd9bd69e2129f4e4e8397f1c7e223685e2f;hp=6059096191101936a668274d0a92a39eabaf543f;hpb=a22041922f160667573e9a5ae3f4195e1668906a;p=tinc diff --git a/src/protocol_auth.c b/src/protocol_auth.c index 60590961..d98e5c4b 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -40,14 +40,14 @@ bool send_id(connection_t *c) { gettimeofday(&c->start, NULL); - return send_request(c, "%d %s %d", ID, myself->connection->name, - myself->connection->protocol_version); + return send_request(c, "%d %s %d.%d", ID, myself->connection->name, + myself->connection->protocol_major, myself->connection->protocol_minor); } bool id_h(connection_t *c, char *request) { char name[MAX_STRING_SIZE]; - if(sscanf(request, "%*d " MAX_STRING " %d", name, &c->protocol_version) != 2) { + if(sscanf(request, "%*d " MAX_STRING " %d.%d", name, &c->protocol_major, &c->protocol_minor) < 2) { logger(LOG_ERR, "Got bad %s from %s (%s)", "ID", c->name, c->hostname); return false; @@ -86,9 +86,9 @@ bool id_h(connection_t *c, char *request) { /* Check if version matches */ - if(c->protocol_version != myself->connection->protocol_version) { - logger(LOG_ERR, "Peer %s (%s) uses incompatible version %d", - c->name, c->hostname, c->protocol_version); + if(c->protocol_major != myself->connection->protocol_major) { + logger(LOG_ERR, "Peer %s (%s) uses incompatible version %d.%d", + c->name, c->hostname, c->protocol_major, c->protocol_minor); return false; } @@ -462,6 +462,9 @@ bool ack_h(connection_t *c, char *request) { c->options &= ~OPTION_CLAMP_MSS; } + if(c->protocol_minor > 0) + c->node->status.ecdh = true; + /* Activate this connection */ c->allow_request = ALL;