Use libvdeplug.h instead of libvdeplug_dyn.h
[tinc] / src / autoconnect.c
index 0fa6f4e..d819ee4 100644 (file)
@@ -80,7 +80,7 @@ static void connect_to_unreachable() {
         * are only a few reachable nodes, and many unreachable ones, we're
         * going to try harder to connect to them. */
 
-       int r = rand() % node_tree->count;
+       unsigned int r = rand() % node_tree->count;
 
        for splay_each(node_t, n, node_tree) {
                if(r--) {
@@ -186,10 +186,9 @@ void do_autoconnect() {
                drop_superfluous_outgoing_connection();
        }
 
+       /* Drop pending outgoing connections from the outgoing list. */
+       drop_superfluous_pending_connections();
 
        /* Check if there are unreachable nodes that we should try to connect to. */
        connect_to_unreachable();
-
-       /* Drop pending outgoing connections from the outgoing list. */
-       drop_superfluous_pending_connections();
 }