X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fgraph.c;h=d86ac4a81e3ea560e8a14f15b9180399570d3d0a;hb=947f09ff2c507a80bbe7f92ed0d41b06c98d5375;hp=1a1e237595076fd9bad0fe55e0ab3c6c60ffe699;hpb=282b99f3c71705bd6e34d4e4f9e8369ea63c87ed;p=meshlink diff --git a/src/graph.c b/src/graph.c index 1a1e2375..d86ac4a8 100644 --- a/src/graph.c +++ b/src/graph.c @@ -196,6 +196,15 @@ static void check_reachability(meshlink_handle_t *mesh) { /* Check reachability status. */ for splay_each(node_t, n, mesh->nodes) { + /* Check for nodes that have changed session_id */ + if(n->status.visited && n->prevedge && n->prevedge->reverse->session_id != n->session_id) { + n->session_id = n->prevedge->reverse->session_id; + + if(n->utcp) { + utcp_abort_all_connections(n->utcp); + } + } + if(n->status.visited != n->status.reachable) { n->status.reachable = !n->status.reachable; n->last_state_change = mesh->loop.now.tv_sec; @@ -228,7 +237,7 @@ static void check_reachability(meshlink_handle_t *mesh) { update_node_udp(mesh, n, NULL); n->status.broadcast = false; } else if(n->connection) { - if(n->connection->outgoing) { + if(n->connection->status.initiator) { send_req_key(mesh, n); } }