]> git.meshlink.io Git - meshlink/commitdiff
Remember recently used addresses of other nodes.
authorGuus Sliepen <guus@meshlink.io>
Mon, 14 Aug 2017 19:24:57 +0000 (21:24 +0200)
committerGuus Sliepen <guus@meshlink.io>
Mon, 14 Aug 2017 19:24:57 +0000 (21:24 +0200)
src/node.c

index f55ff370f61269a6c57bdcc532b824a85f057389..af02fe27dc7ba70ac396318ab250889b39160548 100644 (file)
@@ -126,7 +126,9 @@ void update_node_udp(meshlink_handle_t *mesh, node_t *n, const sockaddr_t *sa) {
                }
                hash_insert(mesh->node_udp_cache, sa, n);
                free(n->hostname);
+
                n->hostname = sockaddr2hostname(&n->address);
+               meshlink_hint_address(mesh, (meshlink_node_t *)n, &sa->sa);
                logger(mesh, MESHLINK_DEBUG, "UDP address of %s set to %s", n->name, n->hostname);
        }
 }