From: Matthias Wachs Date: Fri, 18 Nov 2011 13:00:55 +0000 (+0000) Subject: port was missing, udp broadcast for ipv4 is now complete X-Git-Tag: initial-import-from-subversion-38251~15874 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=54bcbbc78a67a4abe184bc45b0570a8d0beb36e4;p=oweals%2Fgnunet.git port was missing, udp broadcast for ipv4 is now complete --- diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 949023fd1..4fbd3f0ac 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c @@ -1539,15 +1539,19 @@ udp_broadcast_send (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) sent = 0; baddr = plugin->head; - while (baddr != NULL) + /* just IPv4 */ + while ((baddr != NULL) && (baddr->addrlen == sizeof (struct sockaddr_in))) { + struct sockaddr_in * addr = (struct sockaddr_in * ) baddr->addr; + addr->sin_port = htons (plugin->broadcast_port); + sent = GNUNET_NETWORK_socket_sendto (plugin->sockv4_broadcast, msg, msg_size, - baddr->addr, - baddr->addrlen); + (const struct sockaddr *) addr, + baddr->addrlen); if (sent == GNUNET_SYSERR) GNUNET_log_strerror(GNUNET_ERROR_TYPE_ERROR, "sendto"); else - LOG (GNUNET_ERROR_TYPE_ERROR, "Sent HELLO beacon broadcast with %i bytes to address %s\n", + LOG (GNUNET_ERROR_TYPE_DEBUG, "Sent HELLO beacon broadcast with %i bytes to address %s\n", sent, GNUNET_a2s(baddr->addr, baddr->addrlen)); baddr = baddr->next; }