X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fgraph.c;h=621dd9be3ae0246e316a7b96760a1d29fb5adb25;hb=bb6b97ce3493d49b79f1bd57fdac420c312ef8d6;hp=9da552e743ccf36b4b8b2f834f4c0f6c2188e541;hpb=7a71d48009e03ff1143a6e1084803f456a27c849;p=tinc diff --git a/src/graph.c b/src/graph.c index 9da552e7..621dd9be 100644 --- a/src/graph.c +++ b/src/graph.c @@ -188,7 +188,8 @@ static void sssp_bfs(void) { e->to->options = e->options; e->to->distance = n->distance + 1; - if(e->to->address.sa.sa_family == AF_UNSPEC && e->address.sa.sa_family != AF_UNKNOWN) + if(!e->to->status.reachable || (e->to->address.sa.sa_family == AF_UNSPEC && e->address.sa.sa_family != AF_UNKNOWN) +) update_node_udp(e->to, &e->address); list_insert_tail(todo_list, e->to); @@ -217,6 +218,7 @@ static void check_reachability(void) { if(n->status.visited != n->status.reachable) { n->status.reachable = !n->status.reachable; + n->last_state_change = time(NULL); if(n->status.reachable) { logger(DEBUG_TRAFFIC, LOG_DEBUG, "Node %s (%s) became reachable", @@ -232,6 +234,10 @@ static void check_reachability(void) { /* TODO: only clear status.validkey if node is unreachable? */ n->status.validkey = false; + if(n->status.sptps) { + sptps_stop(&n->sptps); + n->status.waitingforkey = false; + } n->last_req_key = 0; n->maxmtu = MTU;