aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Sivachenko <demon@FreeBSD.org>2014-01-05 08:14:25 +0000
committerDmitry Sivachenko <demon@FreeBSD.org>2014-01-05 08:14:25 +0000
commit9322378f74a4f30723526ff97db8622a5f743c40 (patch)
tree03d59cb5ae6774ff1827a8da075da347a36fa207
parent75af857b3ffb90cdf614b17eeb69fffe5a91590d (diff)
downloadports-9322378f74a4f30723526ff97db8622a5f743c40.tar.gz
ports-9322378f74a4f30723526ff97db8622a5f743c40.zip
Notes
-rw-r--r--net-mgmt/collectd5/Makefile2
-rw-r--r--net-mgmt/collectd5/files/patch-src-interface.c36
2 files changed, 37 insertions, 1 deletions
diff --git a/net-mgmt/collectd5/Makefile b/net-mgmt/collectd5/Makefile
index 703503da9315..87dfd3744b3c 100644
--- a/net-mgmt/collectd5/Makefile
+++ b/net-mgmt/collectd5/Makefile
@@ -3,7 +3,7 @@
PORTNAME= collectd
PORTVERSION= 5.4.0
-PORTREVISION= 2
+PORTREVISION= 3
PKGNAMESUFFIX= 5
CATEGORIES= net-mgmt
MASTER_SITES= http://collectd.org/files/
diff --git a/net-mgmt/collectd5/files/patch-src-interface.c b/net-mgmt/collectd5/files/patch-src-interface.c
new file mode 100644
index 000000000000..f2ad3d2bb601
--- /dev/null
+++ b/net-mgmt/collectd5/files/patch-src-interface.c
@@ -0,0 +1,36 @@
+--- src/interface.c.orig 2014-01-05 00:36:58.000000000 +0400
++++ src/interface.c 2014-01-05 00:45:10.000000000 +0400
+@@ -212,20 +212,19 @@ static int interface_read (void)
+ return (-1);
+
+ for (if_ptr = if_list; if_ptr != NULL; if_ptr = if_ptr->ifa_next)
+- {
+- if ((if_data = (struct IFA_DATA *) if_ptr->ifa_data) == NULL)
+- continue;
+-
+- if_submit (if_ptr->ifa_name, "if_octets",
+- if_data->IFA_RX_BYTES,
+- if_data->IFA_TX_BYTES);
+- if_submit (if_ptr->ifa_name, "if_packets",
+- if_data->IFA_RX_PACKT,
+- if_data->IFA_TX_PACKT);
+- if_submit (if_ptr->ifa_name, "if_errors",
+- if_data->IFA_RX_ERROR,
+- if_data->IFA_TX_ERROR);
+- }
++ if (if_ptr->ifa_addr != NULL && if_ptr->ifa_addr->sa_family == AF_LINK) {
++ if_data = (struct IFA_DATA *) if_ptr->ifa_data;
++
++ if_submit (if_ptr->ifa_name, "if_octets",
++ if_data->IFA_RX_BYTES,
++ if_data->IFA_TX_BYTES);
++ if_submit (if_ptr->ifa_name, "if_packets",
++ if_data->IFA_RX_PACKT,
++ if_data->IFA_TX_PACKT);
++ if_submit (if_ptr->ifa_name, "if_errors",
++ if_data->IFA_RX_ERROR,
++ if_data->IFA_TX_ERROR);
++ }
+
+ freeifaddrs (if_list);
+ /* #endif HAVE_GETIFADDRS */