fix for mantis 0002462
authorMatthias Wachs <wachs@net.in.tum.de>
Tue, 26 Jun 2012 13:01:54 +0000 (13:01 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Tue, 26 Jun 2012 13:01:54 +0000 (13:01 +0000)
src/transport/gnunet-service-transport_neighbours.c

index 9c7a70a96bb85974b902b8723b909341ec7d5809..6c3486691a8294148debda664a4c40ea3c30ccac 100644 (file)
@@ -1255,8 +1255,9 @@ try_transmission_to_peer (struct NeighbourMapEntry *n)
 
 /**
  * Send keepalive message to the neighbour.  Must only be called
- * if we are on 'connected' state.  Will internally determine
- * if a keepalive is truly needed (so can always be called).
+ * if we are on 'connected' state or while trying to switch addresses.
+ * Will internally determine if a keepalive is truly needed (so can
+ * always be called).
  *
  * @param n neighbour that went idle and needs a keepalive
  */
@@ -1265,7 +1266,9 @@ send_keepalive (struct NeighbourMapEntry *n)
 {
   struct GNUNET_MessageHeader m;
 
-  GNUNET_assert (S_CONNECTED == n->state);
+  GNUNET_assert ((S_CONNECTED == n->state) ||
+                 (S_CONNECTED_SWITCHING_BLACKLIST == n->state) ||
+                 (S_CONNECTED_SWITCHING_CONNECT_SENT));
   if (GNUNET_TIME_absolute_get_remaining (n->keep_alive_time).rel_value > 0)
     return; /* no keepalive needed at this time */
   m.size = htons (sizeof (struct GNUNET_MessageHeader));