plugin->send_ipv4_broadcast_task = GNUNET_SCHEDULER_NO_TASK;
msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf);
- sent = 0;
+
baddr = plugin->ipv4_broadcast_head;
/* just IPv4 */
while ((msg_size > 0) && (baddr != NULL) && (baddr->addrlen == sizeof (struct sockaddr_in)))
plugin->send_ipv6_broadcast_task = GNUNET_SCHEDULER_NO_TASK;
msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf);
- sent = 0;
sent = GNUNET_NETWORK_socket_sendto (plugin->sockv6, &buf, msg_size,
(const struct sockaddr *)
&plugin->ipv6_multicast_address,
void
-setup_broadcast (struct Plugin *plugin, struct sockaddr_in6 *serverAddrv6, struct sockaddr_in *serverAddrv4)
+setup_broadcast (struct Plugin *plugin, struct sockaddr_in6 *server_addrv6, struct sockaddr_in *server_addrv4)
{
const struct GNUNET_MessageHeader *hello;
hello = plugin->env->get_our_hello ();
/* create IPv4 broadcast socket */
plugin->broadcast_ipv4 = GNUNET_NO;
- if (plugin->sockv4 != NULL)
+ if ((GNUNET_YES == plugin->enable_ipv4) && (plugin->sockv4 != NULL))
{
int yes = 1;
LOG (GNUNET_ERROR_TYPE_WARNING,
_
("Failed to set IPv4 broadcast option for broadcast socket on port %d\n"),
- ntohs (serverAddrv4->sin_port));
+ ntohs (server_addrv4->sin_port));
}
else
{
}
plugin->broadcast_ipv6 = GNUNET_NO;
- if (plugin->sockv6 != NULL)
+ if ((GNUNET_YES == plugin->enable_ipv6) && (plugin->sockv6 != NULL))
{
memset (&plugin->ipv6_multicast_address, 0, sizeof (struct sockaddr_in6));
GNUNET_assert (1 ==