X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fprotocol_key.c;h=2c741be504a71d3e91e32e555e0ab974ad7a2cd8;hb=f13b47a184094c6c9c22faf22c4e6b1117a1d758;hp=8a1d6000947df5057953c5212c44529ebb2b5026;hpb=fe5563f92021618b4a8b41e412c73d8364fcaf6e;p=meshlink diff --git a/src/protocol_key.c b/src/protocol_key.c index 8a1d6000..2c741be5 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -135,7 +135,7 @@ static bool req_key_ext_h(meshlink_handle_t *mesh, connection_t *c, const char * for list_each(outgoing_t, outgoing, mesh->outgoings) { if(outgoing->node == from && outgoing->ev.cb) { outgoing->timeout = 0; - timeout_set(&mesh->loop, &outgoing->ev, &(struct timeval) { + timeout_set(&mesh->loop, &outgoing->ev, &(struct timespec) { 0, 0 }); } @@ -334,12 +334,12 @@ bool ans_key_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { /* Append the known UDP address of the from node, if we have a confirmed one */ if(!*address && from->status.udp_confirmed && from->address.sa.sa_family != AF_UNSPEC) { - char *address, *port; + char *reflexive_address, *reflexive_port; logger(mesh, MESHLINK_DEBUG, "Appending reflexive UDP address to ANS_KEY from %s to %s", from->name, to->name); - sockaddr2str(&from->address, &address, &port); - send_request(mesh, to->nexthop->connection, NULL, "%s %s %s", request, address, port); - free(address); - free(port); + sockaddr2str(&from->address, &reflexive_address, &reflexive_port); + send_request(mesh, to->nexthop->connection, NULL, "%s %s %s", request, reflexive_address, reflexive_port); + free(reflexive_address); + free(reflexive_port); return true; } @@ -354,7 +354,7 @@ bool ans_key_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { /* Inform all other nodes we want to communicate with and which are reachable via this connection */ for splay_each(node_t, n, mesh->nodes) { - if(n->nexthop == c->node) { + if(n->nexthop != c->node) { continue; }