]> git.meshlink.io Git - meshlink/commitdiff
Autoconnect to reachable nodes without known public keys
authorGuus Sliepen <guus@meshlink.io>
Thu, 23 May 2019 21:20:01 +0000 (23:20 +0200)
committerGuus Sliepen <guus@meshlink.io>
Thu, 13 Jun 2019 21:48:14 +0000 (23:48 +0200)
We must allow the autoconnect algorithm to try connections to nodes that
are online but for which we don't have a public key, otherwise we risk
that no connections are formed at all, except to the inviting node.

src/net.c

index 348c9e343b34a14dae8b04a9b4a2902035d5d6df..a1cccbdf8e875471064f7d0b1367677814e75afe 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -500,7 +500,7 @@ static void periodic_handler(event_loop_t *loop, void *data) {
                                }
                        }
 
-                       if(!node_read_public_key(mesh, connect_to)) {
+                       if(!connect_to->status.reachable && !node_read_public_key(mesh, connect_to)) {
                                logger(mesh, MESHLINK_DEBUG, "* skip autoconnect since we don't know this node's public key");
                                skip = true;
                        }