fix lower_rung() logic
authorChristian Grothoff <christian@grothoff.org>
Tue, 31 Jan 2017 16:41:09 +0000 (17:41 +0100)
committerChristian Grothoff <christian@grothoff.org>
Tue, 31 Jan 2017 16:41:09 +0000 (17:41 +0100)
src/cadet/gnunet-service-cadet-new_core.c

index bb33dac409376dd6eef2253987b20bad1e506527..70d0cb83ec529c46b0ca593d7e7df143a5cd2426 100644 (file)
@@ -278,15 +278,11 @@ lower_rung (struct RouteDirection *dir)
                                        rung->prev,
                                        prev);
   }
-  else
-  {
-    rung = prev;
-  }
-  GNUNET_assert (NULL != rung);
-  GNUNET_CONTAINER_DLL_insert (rung->rd_head,
-                               rung->rd_tail,
+  GNUNET_assert (NULL != prev);
+  GNUNET_CONTAINER_DLL_insert (prev->rd_head,
+                               prev->rd_tail,
                                dir);
-  dir->rung = rung;
+  dir->rung = prev;
 }