X-Git-Url: https://git.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_packet.c;h=7bd619fe2e4f1abe8aba67f8b8821699a7019015;hb=04543a57e73e29c3e2a1968fd330f03c94dd6059;hp=217518061a15a30a15837e5fe7d1afd9b3f95a86;hpb=ca989c0c8b19901cbd7664a9d2b42aa85c9c176e;p=tinc diff --git a/src/net_packet.c b/src/net_packet.c index 21751806..7bd619fe 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -30,6 +30,7 @@ #include LZO1X_H #endif +#include "address_cache.h" #include "cipher.h" #include "conf.h" #include "connection.h" @@ -153,7 +154,13 @@ static void udp_probe_h(node_t *n, vpn_packet_t *packet, length_t len) { /* It's a valid reply: now we know bidirectional communication is possible using the address and socket that the reply packet used. */ - n->status.udp_confirmed = true; + if(!n->status.udp_confirmed) { + n->status.udp_confirmed = true; + fprintf(stderr, "Updating address cache...\n"); + if (!n->address_cache) + n->address_cache = open_address_cache(n); + reset_address_cache(n->address_cache, &n->address); + } // Reset the UDP ping timer. n->udp_ping_sent = now;