diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-06-29 12:25:08 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-06-29 12:25:08 +0000 |
commit | 350eadf5aca8fb74d6b58d6e89af0c54e3edaa9a (patch) | |
tree | 44da51c85223a8c77a139ba4ed8075db6e08e34c /src/transport/plugin_transport_udp_broadcasting.c | |
parent | 2ef643ac2535a15d8107a2daff605b7c070edb15 (diff) | |
download | gnunet-350eadf5aca8fb74d6b58d6e89af0c54e3edaa9a.tar.gz gnunet-350eadf5aca8fb74d6b58d6e89af0c54e3edaa9a.zip |
do not print error msg when we have no network connectivity
Diffstat (limited to 'src/transport/plugin_transport_udp_broadcasting.c')
-rw-r--r-- | src/transport/plugin_transport_udp_broadcasting.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c index baabf45ea..d418e50d9 100644 --- a/src/transport/plugin_transport_udp_broadcasting.c +++ b/src/transport/plugin_transport_udp_broadcasting.c | |||
@@ -268,7 +268,19 @@ udp_ipv4_broadcast_send (void *cls, | |||
268 | (const struct sockaddr *) addr, | 268 | (const struct sockaddr *) addr, |
269 | baddr->addrlen); | 269 | baddr->addrlen); |
270 | if (sent == GNUNET_SYSERR) | 270 | if (sent == GNUNET_SYSERR) |
271 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sendto"); | 271 | { |
272 | if ((ENETUNREACH == errno) || (ENETDOWN == errno)) | ||
273 | { | ||
274 | /* "Network unreachable" or "Network down" | ||
275 | * | ||
276 | * This indicates that we just do not have network connectivity | ||
277 | */ | ||
278 | GNUNET_log (GNUNET_ERROR_TYPE_BULK | GNUNET_ERROR_TYPE_WARNING, | ||
279 | "Network connectivity is down, cannot send beacon!\n"); | ||
280 | } | ||
281 | else | ||
282 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sendto"); | ||
283 | } | ||
272 | else | 284 | else |
273 | { | 285 | { |
274 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 286 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -301,7 +313,20 @@ udp_ipv6_broadcast_send (void *cls, | |||
301 | &plugin->ipv6_multicast_address, | 313 | &plugin->ipv6_multicast_address, |
302 | sizeof (struct sockaddr_in6)); | 314 | sizeof (struct sockaddr_in6)); |
303 | if (sent == GNUNET_SYSERR) | 315 | if (sent == GNUNET_SYSERR) |
304 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sendto"); | 316 | { |
317 | if ((ENETUNREACH == errno) || (ENETDOWN == errno)) | ||
318 | { | ||
319 | /* "Network unreachable" or "Network down" | ||
320 | * | ||
321 | * This indicates that this system is IPv6 enabled, but does not | ||
322 | * have a valid global IPv6 address assigned | ||
323 | */ | ||
324 | GNUNET_log (GNUNET_ERROR_TYPE_BULK | GNUNET_ERROR_TYPE_WARNING, | ||
325 | "Network connectivity is down, cannot send beacon!\n"); | ||
326 | } | ||
327 | else | ||
328 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sendto"); | ||
329 | } | ||
305 | else | 330 | else |
306 | { | 331 | { |
307 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 332 | LOG (GNUNET_ERROR_TYPE_DEBUG, |