From 350eadf5aca8fb74d6b58d6e89af0c54e3edaa9a Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Fri, 29 Jun 2012 12:25:08 +0000 Subject: [PATCH] do not print error msg when we have no network connectivity --- .../plugin_transport_udp_broadcasting.c | 29 +++++++++++++++++-- src/transport/transport.conf.in | 2 +- 2 files changed, 28 insertions(+), 3 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, (const struct sockaddr *) addr, baddr->addrlen); if (sent == GNUNET_SYSERR) - GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sendto"); + { + if ((ENETUNREACH == errno) || (ENETDOWN == errno)) + { + /* "Network unreachable" or "Network down" + * + * This indicates that we just do not have network connectivity + */ + GNUNET_log (GNUNET_ERROR_TYPE_BULK | GNUNET_ERROR_TYPE_WARNING, + "Network connectivity is down, cannot send beacon!\n"); + } + else + GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sendto"); + } else { LOG (GNUNET_ERROR_TYPE_DEBUG, @@ -301,7 +313,20 @@ udp_ipv6_broadcast_send (void *cls, &plugin->ipv6_multicast_address, sizeof (struct sockaddr_in6)); if (sent == GNUNET_SYSERR) - GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sendto"); + { + if ((ENETUNREACH == errno) || (ENETDOWN == errno)) + { + /* "Network unreachable" or "Network down" + * + * This indicates that this system is IPv6 enabled, but does not + * have a valid global IPv6 address assigned + */ + GNUNET_log (GNUNET_ERROR_TYPE_BULK | GNUNET_ERROR_TYPE_WARNING, + "Network connectivity is down, cannot send beacon!\n"); + } + else + GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sendto"); + } else { LOG (GNUNET_ERROR_TYPE_DEBUG, diff --git a/src/transport/transport.conf.in b/src/transport/transport.conf.in index 9a6f5d912..fd67b70d6 100644 --- a/src/transport/transport.conf.in +++ b/src/transport/transport.conf.in @@ -47,7 +47,7 @@ MAX_CONNECTIONS = 128 [transport-udp] PORT = 2086 BROADCAST = YES -BROADCAST_INTERVAL = 30000 +BROADCAST_INTERVAL = 300 MAX_BPS = 1000000 [transport-http] -- 2.25.1