Avoid calling time(NULL).
[tinc] / src / protocol_auth.c
index 1b061b3..ba5db2e 100644 (file)
@@ -139,7 +139,7 @@ bool send_id(connection_t *c) {
                        minor = myself->connection->protocol_minor;
        }
 
-       if(proxytype)
+       if(proxytype && c->outgoing)
                if(!send_proxyrequest(c))
                        return false;
 
@@ -160,7 +160,7 @@ bool id_h(connection_t *c, const char *request) {
        if(name[0] == '^' && !strcmp(name + 1, controlcookie)) {
                c->status.control = true;
                c->allow_request = CONTROL;
-               c->last_ping_time = time(NULL) + 3600;
+               c->last_ping_time = now.tv_sec + 3600;
 
                free(c->name);
                c->name = xstrdup("<control>");