X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fnetwork.c;h=e0c329c6f0abae9f10231a08f14fb08d72cfab90;hb=8e36aa7fbb102c08c46666bcd7ec6ee43c40c684;hp=840577f5b49509f1d197c734666b91341d7b7eb8;hpb=3dffa6fb50c66249fb3da7592c7a9385edb74677;p=collectd.git diff --git a/src/network.c b/src/network.c index 840577f5..e0c329c6 100644 --- a/src/network.c +++ b/src/network.c @@ -259,6 +259,7 @@ typedef struct receive_list_entry_s receive_list_entry_t; * Private variables */ static int network_config_ttl = 0; +/* Ethernet - (IPv6 + UDP) = 1500 - (40 + 8) = 1452 */ static size_t network_config_packet_size = 1452; static int network_config_forward = 0; static int network_config_stats = 0; @@ -1702,9 +1703,9 @@ 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) { +#if defined(HAVE_IF_INDEXTONAME) && HAVE_IF_INDEXTONAME && defined(SO_BINDTODEVICE) char interface_name[IFNAMSIZ]; if (if_indextoname (se->interface, interface_name) == NULL) @@ -1721,20 +1722,21 @@ static int network_set_interface (const sockent_t *se, const struct addrinfo *ai sstrerror (errno, errbuf, sizeof (errbuf))); return (-1); } - } /* #endif HAVE_IF_INDEXTONAME && SO_BINDTODEVICE */ #else - WARNING ("network plugin: Cannot set the interface on a unicast " + WARNING ("network plugin: Cannot set the interface on a unicast " "socket because " # if !defined(SO_BINDTODEVICE) - "the the \"SO_BINDTODEVICE\" socket option " + "the \"SO_BINDTODEVICE\" socket option " # else "the \"if_indextoname\" function " # endif "is not available on your system."); #endif + } + return (0); } /* }}} network_set_interface */