]> git.meshlink.io Git - meshlink/commitdiff
fixing comparison expression
authorNiklas Hofmann <niklas.hofmann@everbase.net>
Wed, 13 Aug 2014 07:27:05 +0000 (09:27 +0200)
committerNiklas Hofmann <niklas.hofmann@everbase.net>
Wed, 13 Aug 2014 07:27:05 +0000 (09:27 +0200)
src/net.c

index a528eb43979c3f7ccf86cebf2fa164ee2559f24a..c33c69c3062beeddbbc882464302111683ad4d59 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -374,7 +374,7 @@ static void periodic_handler(event_loop_t *loop, void *data) {
 
                // find better nodes to connect to
 
-               if(!connect_to && min_connects <= cur_connects < max_connects)
+               if(!connect_to && min_connects <= cur_connects && cur_connects < max_connects)
                {
                        unsigned int connects = 0;
 
@@ -415,7 +415,7 @@ static void periodic_handler(event_loop_t *loop, void *data) {
 
                // heal partitions
 
-               if(!connect_to && min_connects <= cur_connects < max_connects)
+               if(!connect_to && min_connects <= cur_connects && cur_connects < max_connects)
                {
                        splay_tree_t *nodes = splay_alloc_tree(node_compare_devclass_asc_last_connect_try_desc, NULL);
 
@@ -462,7 +462,7 @@ static void periodic_handler(event_loop_t *loop, void *data) {
 
                // disconnect suboptimal outgoing connections
 
-               if(min_connects < cur_connects <= max_connects)
+               if(min_connects < cur_connects && cur_connects <= max_connects)
                {
                        unsigned int connects = 0;