Update "now" after connect() when making outgoing connections.
[oweals/tinc.git] / src / net_socket.c
index cb271063b0bc5d25ad22d3d0cec65e66ad5052f8..c167c2f3a5e00eb21f74b99897ac851b73b9404a 100644 (file)
@@ -457,8 +457,11 @@ begin:
                freeaddrinfo(proxyai);
        }
 
+       now = time(NULL);
+
        if(result == -1) {
                if(sockinprogress(sockerrno)) {
+                       c->last_ping_time = now;
                        c->status.connecting = true;
                        return;
                }