From: Florian Forster Date: Mon, 5 Apr 2010 14:32:19 +0000 (+0200) Subject: network plugin: Print a warning when setting the interface on a unicast socket is... X-Git-Tag: collectd-4.10.0~22 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=dbe559f1627d886078d27c59f21f4f6572c00f0b;p=collectd.git network plugin: Print a warning when setting the interface on a unicast socket is not possible. --- diff --git a/src/network.c b/src/network.c index 9cb8c38e..af4a117c 100644 --- a/src/network.c +++ b/src/network.c @@ -1653,6 +1653,7 @@ static int network_set_interface (const sockent_t *se, const struct addrinfo *ai } } + /* else: Not a multicast interface. */ #if defined(HAVE_IF_INDEXTONAME) && HAVE_IF_INDEXTONAME && defined(SO_BINDTODEVICE) if (se->interface != 0) { @@ -1673,7 +1674,18 @@ static int network_set_interface (const sockent_t *se, const struct addrinfo *ai return (-1); } } -#endif /* HAVE_IF_INDEXTONAME && SO_BINDTODEVICE */ +/* #endif HAVE_IF_INDEXTONAME && SO_BINDTODEVICE */ + +#else + WARNING ("network plugin: Cannot set the interface on a unicast " + "socket because " +# if !defined(SO_BINDTODEVICE) + "the the \"SO_BINDTODEVICE\" socket option " +# else + "the \"if_indextoname\" function " +# endif + "is not available on your system."); +#endif return (0); } /* }}} network_set_interface */