fix loop detection logic
authorChristian Grothoff <christian@grothoff.org>
Tue, 31 Jan 2017 16:02:24 +0000 (17:02 +0100)
committerChristian Grothoff <christian@grothoff.org>
Tue, 31 Jan 2017 16:02:24 +0000 (17:02 +0100)
src/cadet/gnunet-service-cadet-new_paths.c

index 28c43d1cf6cc7d0fe5befa1aaf98d2f1598fa2c5..39026dbe74346e9f4dfc94267eb72097cb823301 100644 (file)
@@ -494,7 +494,7 @@ GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity *get_path,
     /* Check that no peer is twice on the path */
     for (unsigned int i=0;i<off - skip;i++)
     {
-      if (cpath[i] == cpath[off])
+      if (cpath[i] == cpath[off - skip])
       {
         skip = off - i;
         break;