Add UDP discovery mechanism.
[tinc] / src / graph.c
index 8f601c2..c0a5d0a 100644 (file)
@@ -241,6 +241,7 @@ static void check_reachability(void) {
                        n->minmtu = 0;
                        n->mtuprobes = 0;
 
+                       timeout_del(&n->udp_ping_timeout);
                        timeout_del(&n->mtutimeout);
 
                        char *name;
@@ -275,13 +276,6 @@ static void check_reachability(void) {
                                update_node_udp(n, NULL);
                                memset(&n->status, 0, sizeof n->status);
                                n->options = 0;
-                       } else if(n->connection) {
-                               if(n->status.sptps) {
-                                       if(n->connection->outgoing)
-                                               send_req_key(n);
-                               } else {
-                                       send_ans_key(n);
-                               }
                        }
                }
 
@@ -292,7 +286,7 @@ static void check_reachability(void) {
        if (device_standby) {
                if (reachable_count == 0 && became_unreachable_count > 0)
                        device_disable();
-               else if (reachable_count == became_reachable_count)
+               else if (reachable_count > 0 && reachable_count == became_reachable_count)
                        device_enable();
        }
 }