Fix handling partial SPTPS messages in sptps_test.
[tinc] / src / protocol_misc.c
index a78728f..d808d73 100644 (file)
@@ -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;