Fix the previous commit.
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 5 Jun 2016 13:20:57 +0000 (15:20 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 5 Jun 2016 13:20:57 +0000 (15:20 +0200)
src/protocol_auth.c

index 65c5e89..31b1f1e 100644 (file)
@@ -866,7 +866,8 @@ bool ack_h(connection_t *c, const char *request) {
        c->edge = new_edge();
        c->edge->from = myself;
        c->edge->to = n;
-       sockaddr_setport(&c->address, hisport);
+       sockaddrcpy(&c->edge->address, &c->address);
+       sockaddr_setport(&c->edge->address, hisport);
        sockaddr_t local_sa;
        socklen_t local_salen = sizeof local_sa;
        if (getsockname(c->socket, &local_sa.sa, &local_salen) < 0)