-ignore PING/PONG from self
authorChristian Grothoff <christian@grothoff.org>
Mon, 26 Oct 2015 17:15:14 +0000 (17:15 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 26 Oct 2015 17:15:14 +0000 (17:15 +0000)
src/transport/gnunet-service-transport_validation.c

index 5470ce8a6afba7ff906a433e38bd94a15bd3e183..9b69b5ddd62fda73b348ad784273e4274b2ec6c8 100644 (file)
@@ -1060,6 +1060,11 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
   ssize_t ret;
   struct GNUNET_HELLO_Address address;
 
+  if (0 ==
+      memcmp (&GST_my_identity,
+              sender,
+              sizeof (struct GNUNET_PeerIdentity)))
+    return; /* our own, ignore! */
   if (ntohs (hdr->size) < sizeof (struct TransportPingMessage))
   {
     GNUNET_break_op (0);
@@ -1388,6 +1393,12 @@ GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender,
   int sig_res;
   int do_verify;
 
+  if (0 ==
+      memcmp (&GST_my_identity,
+              sender,
+              sizeof (struct GNUNET_PeerIdentity)))
+    return; /* our own, ignore! */
+
   if (ntohs (hdr->size) < sizeof (struct TransportPongMessage))
   {
     GNUNET_break_op (0);