gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r21341 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r21341 - gnunet/src/transport
Date: Tue, 8 May 2012 14:35:29 +0200

Author: wachs
Date: 2012-05-08 14:35:29 +0200 (Tue, 08 May 2012)
New Revision: 21341

Modified:
   gnunet/src/transport/plugin_transport_udp.c
   gnunet/src/transport/plugin_transport_udp_broadcasting.c
Log:
- fix crashes


Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2012-05-08 12:30:28 UTC (rev 
21340)
+++ gnunet/src/transport/plugin_transport_udp.c 2012-05-08 12:35:29 UTC (rev 
21341)
@@ -1521,17 +1521,19 @@
   s->last_expected_delay = GNUNET_FRAGMENT_context_destroy (s->frag_ctx->frag);
 
   struct UDPMessageWrapper * udpw = NULL;
+  struct UDPMessageWrapper * tmp = NULL;
   if (s->addrlen == sizeof (struct sockaddr_in6))
   {
     udpw = plugin->ipv6_queue_head;
     while (udpw!= NULL)
     {
+      tmp = udpw->next;
       if ((udpw->frag_ctx != NULL) && (udpw->frag_ctx == s->frag_ctx))
       {
         GNUNET_CONTAINER_DLL_remove(plugin->ipv6_queue_head, 
plugin->ipv6_queue_tail, udpw);
         GNUNET_free (udpw);
       }
-      udpw = udpw->next;
+      udpw = tmp;
     }
   }
   if (s->addrlen == sizeof (struct sockaddr_in))
@@ -1539,12 +1541,13 @@
     udpw = plugin->ipv4_queue_head;
     while (udpw!= NULL)
     {
+      tmp = udpw->next;
       if ((udpw->frag_ctx != NULL) && (udpw->frag_ctx == s->frag_ctx))
       {
         GNUNET_CONTAINER_DLL_remove(plugin->ipv4_queue_head, 
plugin->ipv4_queue_tail, udpw);
         GNUNET_free (udpw);
       }
-      udpw = udpw->next;
+      udpw = tmp;
     }
   }
 

Modified: gnunet/src/transport/plugin_transport_udp_broadcasting.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp_broadcasting.c    2012-05-08 
12:30:28 UTC (rev 21340)
+++ gnunet/src/transport/plugin_transport_udp_broadcasting.c    2012-05-08 
12:35:29 UTC (rev 21341)
@@ -175,7 +175,7 @@
 {
   struct GNUNET_ATS_Information ats;
 
-  if (addrlen == sizeof (struct sockaddr_in))
+  if ((GNUNET_YES == plugin->broadcast_ipv4) && (addrlen == sizeof (struct 
sockaddr_in)))
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Received IPv4 HELLO beacon broadcast with %i bytes from address 
%s\n",
@@ -189,12 +189,14 @@
     mc->addr.u4_port = av4->sin_port;
     ats = plugin->env->get_address_type (plugin->env->cls, (const struct 
sockaddr *) addr, addrlen);
     mc->ats_address_network_type = ats.value;
+
+    GNUNET_assert (NULL != plugin->broadcast_ipv4_mst);
     if (GNUNET_OK !=
         GNUNET_SERVER_mst_receive (plugin->broadcast_ipv4_mst, mc, buf, size,
                                    GNUNET_NO, GNUNET_NO))
       GNUNET_free (mc);
   }
-  else if (addrlen == sizeof (struct sockaddr_in6))
+  else if ((GNUNET_YES == plugin->broadcast_ipv4) && (addrlen == sizeof 
(struct sockaddr_in6)))
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Received IPv6 HELLO beacon broadcast with %i bytes from address 
%s\n",
@@ -208,7 +210,7 @@
     mc->addr.u6_port = av6->sin6_port;
     ats = plugin->env->get_address_type (plugin->env->cls, (const struct 
sockaddr *) addr, addrlen);
     mc->ats_address_network_type = ats.value;
-
+    GNUNET_assert (NULL != plugin->broadcast_ipv4_mst);
     if (GNUNET_OK !=
         GNUNET_SERVER_mst_receive (plugin->broadcast_ipv6_mst, mc, buf, size,
                                    GNUNET_NO, GNUNET_NO))




reply via email to

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