]> git.meshlink.io Git - meshlink/commitdiff
Dont learn localhost and IPv6 link local with AVAHI
authorSaverio Proto <zioproto@gmail.com>
Sun, 17 Aug 2014 13:15:57 +0000 (15:15 +0200)
committerSaverio Proto <zioproto@gmail.com>
Sun, 17 Aug 2014 13:15:57 +0000 (15:15 +0200)
src/meshlink.c

index 956651155fbe09bffde83dd0ddde1ef47c0aa229..61cd6240a7b97866a745aa9229e042542d9c56c9 100644 (file)
@@ -1836,7 +1836,10 @@ void meshlink_hint_address(meshlink_handle_t *mesh, meshlink_node_t *node, const
 
        if(host && port) {
                xasprintf(&str, "%s %s", host, port);
-               append_config_file(mesh, node->name, "Address", str);
+               if ( (strncmp ("fe80",host,4) != 0) && ( strncmp("127.",host,4) != 0 ) && ( strcmp("localhost",host) !=0 ) )
+                       append_config_file(mesh, node->name, "Address", str);
+               else
+                       logger(mesh, MESHLINK_DEBUG, "Not adding Link Local IPv6 Address to config\n");
        }
 
        free(str);