X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fgraph.c;fp=src%2Fgraph.c;h=5a7a16a77d52cd92a5305afde0c47209fbacfd9a;hp=c100a933a6a1abbcde7e53b8ec9bf759caf1a996;hb=c6a15e27d934e90a1f3a26438dddb395bdc9de19;hpb=1695d8828ed6fb997dbd96e21c105ab5641b90c5 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",