X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fnet.c;h=5f50531b9ff4fada055e90b255ecf9b9f03ea351;hb=d35161640af5862b80df6ae15806c0d079e2cf7e;hp=25cc15042f0b2a74d030acc78d625531e757fee8;hpb=e16463732db2045c884fa47aafa36a07c55b0c5c;p=meshlink diff --git a/src/net.c b/src/net.c index 25cc1504..5f50531b 100644 --- a/src/net.c +++ b/src/net.c @@ -162,18 +162,8 @@ static void periodic_handler(event_loop_t *loop, void *data) { int i = 0; for splay_each(node_t, n, mesh->nodes) { - bool trying_unreachable = false; - - if(i++ != r) { - if(n->status.reachable) { - continue; - } else { - /* If we see an unreachable node - before node i, try it anyway. - */ - trying_unreachable = true; - } - } + if(i++ != r) + continue; if(n->connection) break; @@ -195,15 +185,6 @@ static void periodic_handler(event_loop_t *loop, void *data) { outgoing->name = xstrdup(n->name); list_insert_tail(mesh->outgoings, outgoing); setup_outgoing_connection(mesh, outgoing); - } else if(trying_unreachable) { - /* We're trying an unreachable node instead - of node i. We already have an outgoing - to it. Try the next node rather than - breaking here, to avoid churning on a - connection attempt to the first - unreachable node. - */ - continue; } break; }