From dbe559f1627d886078d27c59f21f4f6572c00f0b Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 5 Apr 2010 16:32:19 +0200 Subject: [PATCH] network plugin: Print a warning when setting the interface on a unicast socket is not possible. --- src/network.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 */ -- 2.11.0