X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fgraph.c;h=5a7a16a77d52cd92a5305afde0c47209fbacfd9a;hb=28be4baae016a5a771d0d9ec6e97ef38a4fc9e46;hp=c100a933a6a1abbcde7e53b8ec9bf759caf1a996;hpb=72091d5c770856870bb8cd51bcc5641078c7562c;p=tinc diff --git a/src/graph.c b/src/graph.c index c100a933..5a7a16a7 100644 --- a/src/graph.c +++ b/src/graph.c @@ -55,6 +55,7 @@ #include "script.h" #include "subnet.h" #include "xalloc.h" +#include "address_cache.h" /* Implementation of Kruskal's algorithm. Running time: O(EN) @@ -226,6 +227,14 @@ static void check_reachability(void) { if(n != myself) { became_reachable_count++; + + if(n->connection && n->connection->outgoing) { + if(!n->address_cache) { + n->address_cache = open_address_cache(n); + } + + add_recent_address(n->address_cache, &n->connection->address); + } } } else { logger(DEBUG_TRAFFIC, LOG_DEBUG, "Node %s (%s) became unreachable",