diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-08-23 11:48:27 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-08-23 11:48:27 +0000 |
commit | 092f6ee135d29f88264d9553d26829c2772f7e16 (patch) | |
tree | 59e02683c642f4ddee2a469535bf1f92bc40cb2a /src/transport/plugin_transport_udp_broadcasting.c | |
parent | ca97e047b8f7052e571e01ec4395f260709ec4a7 (diff) | |
download | gnunet-092f6ee135d29f88264d9553d26829c2772f7e16.tar.gz gnunet-092f6ee135d29f88264d9553d26829c2772f7e16.zip |
plugin test
Diffstat (limited to 'src/transport/plugin_transport_udp_broadcasting.c')
-rw-r--r-- | src/transport/plugin_transport_udp_broadcasting.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c index d418e50d9..db6c1fe8c 100644 --- a/src/transport/plugin_transport_udp_broadcasting.c +++ b/src/transport/plugin_transport_udp_broadcasting.c | |||
@@ -228,6 +228,8 @@ prepare_beacon (struct Plugin *plugin, struct UDP_Beacon_Message *msg) | |||
228 | 228 | ||
229 | const struct GNUNET_MessageHeader *hello; | 229 | const struct GNUNET_MessageHeader *hello; |
230 | hello = plugin->env->get_our_hello (); | 230 | hello = plugin->env->get_our_hello (); |
231 | if (NULL == hello) | ||
232 | return 0; | ||
231 | hello_size = GNUNET_HELLO_size ((struct GNUNET_HELLO_Message *) hello); | 233 | hello_size = GNUNET_HELLO_size ((struct GNUNET_HELLO_Message *) hello); |
232 | msg_size = hello_size + sizeof (struct UDP_Beacon_Message); | 234 | msg_size = hello_size + sizeof (struct UDP_Beacon_Message); |
233 | 235 | ||
@@ -258,7 +260,7 @@ udp_ipv4_broadcast_send (void *cls, | |||
258 | sent = 0; | 260 | sent = 0; |
259 | baddr = plugin->ipv4_broadcast_head; | 261 | baddr = plugin->ipv4_broadcast_head; |
260 | /* just IPv4 */ | 262 | /* just IPv4 */ |
261 | while ((baddr != NULL) && (baddr->addrlen == sizeof (struct sockaddr_in))) | 263 | while ((msg_size > 0) && (baddr != NULL) && (baddr->addrlen == sizeof (struct sockaddr_in))) |
262 | { | 264 | { |
263 | struct sockaddr_in *addr = (struct sockaddr_in *) baddr->addr; | 265 | struct sockaddr_in *addr = (struct sockaddr_in *) baddr->addr; |
264 | 266 | ||