X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_packet.c;h=0b95a939bb84fdc874f115f1a4437d7d84806e3f;hb=1aa8ac8c41ab8580fce1956086d7e6c7e84a09ee;hp=d171fec67b12fa1faee2e141b432ff883310a7b1;hpb=b9a7444b9fa216d16d91f34d2e12f51fc4d60e46;p=tinc diff --git a/src/net_packet.c b/src/net_packet.c index d171fec6..0b95a939 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -53,6 +53,7 @@ #include "protocol.h" #include "route.h" #include "utils.h" +#include "random.h" /* The minimum size of a probe is 14 bytes, but since we normally use CBC mode encryption, we can add a few extra random bytes without increasing the @@ -199,7 +200,10 @@ static void udp_probe_h(node_t *n, vpn_packet_t *packet, length_t len) { n->address_cache = open_address_cache(n); } - reset_address_cache(n->address_cache, &n->address); + if(n->connection && n->connection->edge) { + reset_address_cache(n->address_cache); + add_recent_address(n->address_cache, &n->connection->edge->address); + } } // Reset the UDP ping timer. @@ -1642,6 +1646,7 @@ void broadcast_packet(const node_t *from, vpn_packet_t *packet) { break; + case BMODE_NONE: default: break; }