X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol_auth.c;h=091629a1bd6deeb4c36a83796789fe5b1fd3e2e3;hp=8fa9b93c70adf21149bc6108c9cc3c92fe604a4a;hb=48e353e9fdf189c4fd5fa7ebc76a72535b4f6632;hpb=bd333530db38cb17d0dca01bbe37bd77e89834e0 diff --git a/src/protocol_auth.c b/src/protocol_auth.c index 8fa9b93c..091629a1 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -516,7 +516,6 @@ static void send_everything(connection_t *c) { bool ack_h(connection_t *c) { char hisport[MAX_STRING_SIZE]; - char *hisaddress; int weight, mtu; uint32_t options; node_t *n; @@ -585,9 +584,8 @@ bool ack_h(connection_t *c) { c->edge = new_edge(); c->edge->from = myself; c->edge->to = n; - sockaddr2str(&c->address, &hisaddress, NULL); - c->edge->address = str2sockaddr(hisaddress, hisport); - free(hisaddress); + sockaddrcpy(&c->edge->address, &c->address); + sockaddr_setport(&c->edge->address, hisport); c->edge->weight = (weight + c->estimated_weight) / 2; c->edge->connection = c; c->edge->options = c->options;