summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_udp_broadcasting.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-12-17 20:29:24 +0000
committerChristian Grothoff <christian@grothoff.org>2013-12-17 20:29:24 +0000
commitd969abc1fce8c27ff7bcddcd31d440b636c04e9d (patch)
tree0e56b5d1d7d42fe3855dcce1eae1063adecbe098 /src/transport/plugin_transport_udp_broadcasting.c
parent78e4d67de40513659c205c3e675304aa5274f43d (diff)
Fix assertion failure seen on buildbot ubuntu-armv71-evans,
build 769: .Dec 17 21:19:40-025205 transport-20588 ERROR Assertion failed at plugin_transport_udp_broadcasting.c:253.
Diffstat (limited to 'src/transport/plugin_transport_udp_broadcasting.c')
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index 0503e413a..35c2a0ea5 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -599,13 +599,19 @@ setup_broadcast (struct Plugin *plugin,
const struct GNUNET_MessageHeader *hello;
hello = plugin->env->get_our_hello ();
- if (GNUNET_YES == GNUNET_HELLO_is_friend_only((const struct GNUNET_HELLO_Message *) hello))
+ if (GNUNET_YES ==
+ GNUNET_HELLO_is_friend_only ((const struct GNUNET_HELLO_Message *) hello))
{
LOG (GNUNET_ERROR_TYPE_WARNING,
_("Disabling HELLO broadcasting due to friend-to-friend only configuration!\n"));
return;
}
+ /* always create tokenizers */
+ plugin->broadcast_ipv4_mst =
+ GNUNET_SERVER_mst_create (&broadcast_ipv4_mst_cb, plugin);
+ plugin->broadcast_ipv6_mst =
+ GNUNET_SERVER_mst_create (&broadcast_ipv6_mst_cb, plugin);
/* create IPv4 broadcast socket */
if ((GNUNET_YES == plugin->enable_ipv4) && (NULL != plugin->sockv4))
{
@@ -619,12 +625,6 @@ setup_broadcast (struct Plugin *plugin,
_("Failed to set IPv4 broadcast option for broadcast socket on port %d\n"),
ntohs (server_addrv4->sin_port));
}
- else
- {
- plugin->broadcast_ipv4_mst =
- GNUNET_SERVER_mst_create (broadcast_ipv4_mst_cb, plugin);
- LOG (GNUNET_ERROR_TYPE_DEBUG, "IPv4 Broadcasting running\n");
- }
}
if ((GNUNET_YES == plugin->enable_ipv6) && (plugin->sockv6 != NULL))
{
@@ -634,8 +634,6 @@ setup_broadcast (struct Plugin *plugin,
&plugin->ipv6_multicast_address.sin6_addr));
plugin->ipv6_multicast_address.sin6_family = AF_INET6;
plugin->ipv6_multicast_address.sin6_port = htons (plugin->port);
- plugin->broadcast_ipv6_mst =
- GNUNET_SERVER_mst_create (broadcast_ipv6_mst_cb, plugin);
}
GNUNET_OS_network_interfaces_list (&iface_proc, plugin);
}
@@ -687,10 +685,16 @@ stop_broadcast (struct Plugin *plugin)
GNUNET_free (p->addr);
GNUNET_free (p);
}
- if (plugin->broadcast_ipv4_mst != NULL)
+ if (NULL != plugin->broadcast_ipv4_mst)
+ {
GNUNET_SERVER_mst_destroy (plugin->broadcast_ipv4_mst);
- if (plugin->broadcast_ipv6_mst != NULL)
+ plugin->broadcast_ipv4_mst = NULL;
+ }
+ if (NULL != plugin->broadcast_ipv6_mst)
+ {
GNUNET_SERVER_mst_destroy (plugin->broadcast_ipv6_mst);
+ plugin->broadcast_ipv6_mst = NULL;
+ }
}
/* end of plugin_transport_udp_broadcasting.c */