From: Guus Sliepen Date: Mon, 14 Aug 2017 19:24:57 +0000 (+0200) Subject: Remember recently used addresses of other nodes. X-Git-Url: http://git.meshlink.io/?p=meshlink;a=commitdiff_plain;h=5c5bdd05e17f8758e2ccca9d31c47d73cb1fd148 Remember recently used addresses of other nodes. --- diff --git a/src/node.c b/src/node.c index f55ff370..af02fe27 100644 --- a/src/node.c +++ b/src/node.c @@ -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); } }