X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftcpconns.c;h=5a8f461971a8909391a99d36bb89eacf57d71252;hb=4bc5568e749defb044160bb0cd80c5cb5fa3267c;hp=00cad0e46fa8b4e7857a3c929882a8a6409dacae;hpb=8cf1acdb96d027b1d48c9dfb74fea313e63ceedf;p=collectd.git diff --git a/src/tcpconns.c b/src/tcpconns.c index 00cad0e4..5a8f4619 100644 --- a/src/tcpconns.c +++ b/src/tcpconns.c @@ -33,6 +33,19 @@ #elif HAVE_SYSCTLBYNAME # include # include + +/* Some includes needed for compiling on FreeBSD */ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_SOCKET_H +# include +#endif +#if HAVE_NET_IF_H +# include +#endif + # include # include # include @@ -122,8 +135,8 @@ static void conn_submit_port_entry (port_entry_t *pe) vl.values = values; vl.values_len = 1; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "tcpconns"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "tcpconns", sizeof (vl.plugin)); if (((port_collect_listening != 0) && (pe->flags & PORT_IS_LISTENING)) || (pe->flags & PORT_COLLECT_LOCAL))