aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transport/plugin_transport_udp.c7
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c8
2 files changed, 10 insertions, 5 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index 905b7f995..9a99fc556 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -1521,17 +1521,19 @@ static void read_process_ack (struct Plugin *plugin,
1521 s->last_expected_delay = GNUNET_FRAGMENT_context_destroy (s->frag_ctx->frag); 1521 s->last_expected_delay = GNUNET_FRAGMENT_context_destroy (s->frag_ctx->frag);
1522 1522
1523 struct UDPMessageWrapper * udpw = NULL; 1523 struct UDPMessageWrapper * udpw = NULL;
1524 struct UDPMessageWrapper * tmp = NULL;
1524 if (s->addrlen == sizeof (struct sockaddr_in6)) 1525 if (s->addrlen == sizeof (struct sockaddr_in6))
1525 { 1526 {
1526 udpw = plugin->ipv6_queue_head; 1527 udpw = plugin->ipv6_queue_head;
1527 while (udpw!= NULL) 1528 while (udpw!= NULL)
1528 { 1529 {
1530 tmp = udpw->next;
1529 if ((udpw->frag_ctx != NULL) && (udpw->frag_ctx == s->frag_ctx)) 1531 if ((udpw->frag_ctx != NULL) && (udpw->frag_ctx == s->frag_ctx))
1530 { 1532 {
1531 GNUNET_CONTAINER_DLL_remove(plugin->ipv6_queue_head, plugin->ipv6_queue_tail, udpw); 1533 GNUNET_CONTAINER_DLL_remove(plugin->ipv6_queue_head, plugin->ipv6_queue_tail, udpw);
1532 GNUNET_free (udpw); 1534 GNUNET_free (udpw);
1533 } 1535 }
1534 udpw = udpw->next; 1536 udpw = tmp;
1535 } 1537 }
1536 } 1538 }
1537 if (s->addrlen == sizeof (struct sockaddr_in)) 1539 if (s->addrlen == sizeof (struct sockaddr_in))
@@ -1539,12 +1541,13 @@ static void read_process_ack (struct Plugin *plugin,
1539 udpw = plugin->ipv4_queue_head; 1541 udpw = plugin->ipv4_queue_head;
1540 while (udpw!= NULL) 1542 while (udpw!= NULL)
1541 { 1543 {
1544 tmp = udpw->next;
1542 if ((udpw->frag_ctx != NULL) && (udpw->frag_ctx == s->frag_ctx)) 1545 if ((udpw->frag_ctx != NULL) && (udpw->frag_ctx == s->frag_ctx))
1543 { 1546 {
1544 GNUNET_CONTAINER_DLL_remove(plugin->ipv4_queue_head, plugin->ipv4_queue_tail, udpw); 1547 GNUNET_CONTAINER_DLL_remove(plugin->ipv4_queue_head, plugin->ipv4_queue_tail, udpw);
1545 GNUNET_free (udpw); 1548 GNUNET_free (udpw);
1546 } 1549 }
1547 udpw = udpw->next; 1550 udpw = tmp;
1548 } 1551 }
1549 } 1552 }
1550 1553
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index 623cde2bd..2935d8da3 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -175,7 +175,7 @@ udp_broadcast_receive (struct Plugin *plugin, const char * buf, ssize_t size, st
175{ 175{
176 struct GNUNET_ATS_Information ats; 176 struct GNUNET_ATS_Information ats;
177 177
178 if (addrlen == sizeof (struct sockaddr_in)) 178 if ((GNUNET_YES == plugin->broadcast_ipv4) && (addrlen == sizeof (struct sockaddr_in)))
179 { 179 {
180 LOG (GNUNET_ERROR_TYPE_DEBUG, 180 LOG (GNUNET_ERROR_TYPE_DEBUG,
181 "Received IPv4 HELLO beacon broadcast with %i bytes from address %s\n", 181 "Received IPv4 HELLO beacon broadcast with %i bytes from address %s\n",
@@ -189,12 +189,14 @@ udp_broadcast_receive (struct Plugin *plugin, const char * buf, ssize_t size, st
189 mc->addr.u4_port = av4->sin_port; 189 mc->addr.u4_port = av4->sin_port;
190 ats = plugin->env->get_address_type (plugin->env->cls, (const struct sockaddr *) addr, addrlen); 190 ats = plugin->env->get_address_type (plugin->env->cls, (const struct sockaddr *) addr, addrlen);
191 mc->ats_address_network_type = ats.value; 191 mc->ats_address_network_type = ats.value;
192
193 GNUNET_assert (NULL != plugin->broadcast_ipv4_mst);
192 if (GNUNET_OK != 194 if (GNUNET_OK !=
193 GNUNET_SERVER_mst_receive (plugin->broadcast_ipv4_mst, mc, buf, size, 195 GNUNET_SERVER_mst_receive (plugin->broadcast_ipv4_mst, mc, buf, size,
194 GNUNET_NO, GNUNET_NO)) 196 GNUNET_NO, GNUNET_NO))
195 GNUNET_free (mc); 197 GNUNET_free (mc);
196 } 198 }
197 else if (addrlen == sizeof (struct sockaddr_in6)) 199 else if ((GNUNET_YES == plugin->broadcast_ipv4) && (addrlen == sizeof (struct sockaddr_in6)))
198 { 200 {
199 LOG (GNUNET_ERROR_TYPE_DEBUG, 201 LOG (GNUNET_ERROR_TYPE_DEBUG,
200 "Received IPv6 HELLO beacon broadcast with %i bytes from address %s\n", 202 "Received IPv6 HELLO beacon broadcast with %i bytes from address %s\n",
@@ -208,7 +210,7 @@ udp_broadcast_receive (struct Plugin *plugin, const char * buf, ssize_t size, st
208 mc->addr.u6_port = av6->sin6_port; 210 mc->addr.u6_port = av6->sin6_port;
209 ats = plugin->env->get_address_type (plugin->env->cls, (const struct sockaddr *) addr, addrlen); 211 ats = plugin->env->get_address_type (plugin->env->cls, (const struct sockaddr *) addr, addrlen);
210 mc->ats_address_network_type = ats.value; 212 mc->ats_address_network_type = ats.value;
211 213 GNUNET_assert (NULL != plugin->broadcast_ipv4_mst);
212 if (GNUNET_OK != 214 if (GNUNET_OK !=
213 GNUNET_SERVER_mst_receive (plugin->broadcast_ipv6_mst, mc, buf, size, 215 GNUNET_SERVER_mst_receive (plugin->broadcast_ipv6_mst, mc, buf, size,
214 GNUNET_NO, GNUNET_NO)) 216 GNUNET_NO, GNUNET_NO))