]> git.meshlink.io Git - meshlink/blobdiff - src/protocol_key.c
Fix more compiler warnings.
[meshlink] / src / protocol_key.c
index 8a1d6000947df5057953c5212c44529ebb2b5026..2c741be504a71d3e91e32e555e0ab974ad7a2cd8 100644 (file)
@@ -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;
                                }