projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added safe-guard for kstat libraries
[collectd.git]
/
src
/
network.c
diff --git
a/src/network.c
b/src/network.c
index
840577f
..
e0c329c
100644
(file)
--- 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;
* 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;
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. */
}
/* else: Not a multicast interface. */
-#if defined(HAVE_IF_INDEXTONAME) && HAVE_IF_INDEXTONAME && defined(SO_BINDTODEVICE)
if (se->interface != 0)
{
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)
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);
}
sstrerror (errno, errbuf, sizeof (errbuf)));
return (-1);
}
- }
/* #endif HAVE_IF_INDEXTONAME && SO_BINDTODEVICE */
#else
/* #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)
"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
# else
"the \"if_indextoname\" function "
# endif
"is not available on your system.");
#endif
+ }
+
return (0);
} /* }}} network_set_interface */
return (0);
} /* }}} network_set_interface */