X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprotocol_misc.c;h=d808d73fa6b6c5473adce1dd485db3a48c096efb;hb=2d268fc06bc01419e7f7f32d4da1b560e72e4ad3;hp=a78728fac240cf8f6f2b55e258bd025a38e21f05;hpb=b34eb5555d40b7e87c1e06988250e4977a793c09;p=tinc diff --git a/src/protocol_misc.c b/src/protocol_misc.c index a78728fa..d808d73f 100644 --- a/src/protocol_misc.c +++ b/src/protocol_misc.c @@ -20,6 +20,7 @@ #include "system.h" +#include "address_cache.h" #include "conf.h" #include "connection.h" #include "logger.h" @@ -64,18 +65,11 @@ bool send_pong(connection_t *c) { bool pong_h(connection_t *c, const char *request) { c->status.pinged = false; - /* Succesful connection, reset timeout if this is an outgoing connection. */ + /* Successful connection, reset timeout if this is an outgoing connection. */ if(c->outgoing) { c->outgoing->timeout = 0; - c->outgoing->cfg = NULL; - - if(c->outgoing->ai) { - freeaddrinfo(c->outgoing->ai); - } - - c->outgoing->ai = NULL; - c->outgoing->aip = NULL; + reset_address_cache(c->outgoing->address_cache, &c->address); } return true;