gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r9908 - GNUnet/src/applications/dv/module


From: gnunet
Subject: [GNUnet-SVN] r9908 - GNUnet/src/applications/dv/module
Date: Sun, 27 Dec 2009 09:50:29 +0100

Author: grothoff
Date: 2009-12-27 09:50:29 +0100 (Sun, 27 Dec 2009)
New Revision: 9908

Modified:
   GNUnet/src/applications/dv/module/dv.c
Log:
check for DV messages being transmitted via DV, and don't die on minor internal 
assertions if we can help it

Modified: GNUnet/src/applications/dv/module/dv.c
===================================================================
--- GNUnet/src/applications/dv/module/dv.c      2009-12-27 06:52:50 UTC (rev 
9907)
+++ GNUnet/src/applications/dv/module/dv.c      2009-12-27 08:50:29 UTC (rev 
9908)
@@ -551,9 +551,13 @@
     {
       /* 0 == us */
       GNUNET_mutex_unlock (ctx.dvMutex);
-      coreAPI->loopback_send (&original_sender,
-                              (const char *) packed_message,
-                              ntohs (packed_message->size), GNUNET_YES, NULL);
+      GNUNET_GE_BREAK (NULL, ntohs (packed_message->type) != 
GNUNET_P2P_PROTO_DV_NEIGHBOR_MESSAGE);
+      GNUNET_GE_BREAK (NULL, ntohs (packed_message->type) != 
GNUNET_P2P_PROTO_DV_DATA_MESSAGE);
+      if ( (ntohs (packed_message->type) != 
GNUNET_P2P_PROTO_DV_NEIGHBOR_MESSAGE) &&
+          (ntohs (packed_message->type) != GNUNET_P2P_PROTO_DV_DATA_MESSAGE) )
+       coreAPI->loopback_send (&original_sender,
+                               (const char *) packed_message,
+                               ntohs (packed_message->size), GNUNET_YES, NULL);
       return GNUNET_OK;
     }
 
@@ -796,7 +800,9 @@
     stats->change (stat_dv_received_gossips, 1);
   neighbor = GNUNET_multi_hash_map_get (ctx.direct_neighbors,
                                         &sender->hashPubKey);
-  GNUNET_GE_ASSERT (NULL, neighbor != NULL);
+  GNUNET_GE_BREAK (NULL, neighbor != NULL);
+  if (neighbor == NULL)
+    return GNUNET_OK;
   addUpdateNeighbor (&nmsg->neighbor,
                      ntohl (nmsg->neighbor_id),
                      neighbor, ntohl (nmsg->cost) + 1);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]