trying to fix issue reported by Lurchi
authorChristian Grothoff <christian@grothoff.org>
Sat, 14 Jan 2017 17:01:12 +0000 (18:01 +0100)
committerChristian Grothoff <christian@grothoff.org>
Sat, 14 Jan 2017 17:01:12 +0000 (18:01 +0100)
src/transport/gnunet-service-transport_neighbours.c

index d82112e033b507f538e182f75063506dc87394fc..e1e4f56f801efe3b22247dd2172deedecc7707ae 100644 (file)
@@ -2236,6 +2236,14 @@ GST_neighbours_handle_session_syn (const struct GNUNET_MessageHeader *message,
   scm = (const struct TransportSynMessage *) message;
   GNUNET_break_op (0 == ntohl (scm->reserved));
   ts = GNUNET_TIME_absolute_ntoh (scm->timestamp);
+  if (0 ==
+      memcmp (&GST_my_identity,
+              peer,
+              sizeof (struct GNUNET_PeerIdentity)))
+  {
+    /* loopback connection-to-self, ignore */
+    return GNUNET_SYSERR;
+  }
   n = lookup_neighbour (peer);
   if (NULL == n)
   {