Browse Source

Merge pull request #1666 from hnyman/collectd-simplify

collectd: interface plugin: revert to Linux defaults from BSD-like operations
Jo-Philipp Wich 9 years ago
parent
commit
ad39db848e

+ 1
- 2
utils/collectd/Makefile View File

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=collectd
11 11
 PKG_VERSION:=5.5.0
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 15
 PKG_SOURCE_URL:=http://collectd.org/files/
@@ -184,7 +184,6 @@ endif
184 184
 CONFIGURE_ARGS+= \
185 185
 	--disable-debug \
186 186
 	--enable-daemon \
187
-	--enable-getifaddrs \
188 187
 	--with-nan-emulation \
189 188
 	--without-libgcrypt
190 189
 

+ 0
- 46
utils/collectd/patches/110-net-device-stats.patch View File

@@ -1,46 +0,0 @@
1
----
2
- src/interface.c |   33 ++++++++++++++++++++++++++++++++-
3
- 1 file changed, 32 insertions(+), 1 deletion(-)
4
-
5
---- a/src/interface.c
6
-+++ b/src/interface.c
7
-@@ -203,7 +203,38 @@ static int interface_read (void)
8
- #  define IFA_RX_ERROR rx_errors
9
- #  define IFA_TX_ERROR tx_errors
10
- #else
11
--#  error "No suitable type for `struct ifaddrs->ifa_data' found."
12
-+struct net_device_stats {
13
-+	unsigned long	rx_packets;
14
-+	unsigned long	tx_packets;
15
-+	unsigned long	rx_bytes;
16
-+	unsigned long	tx_bytes;
17
-+	unsigned long	rx_errors;
18
-+	unsigned long	tx_errors;
19
-+	unsigned long	rx_dropped;
20
-+	unsigned long	tx_dropped;
21
-+	unsigned long	multicast;
22
-+	unsigned long	collisions;
23
-+	unsigned long	rx_length_errors;
24
-+	unsigned long	rx_over_errors;
25
-+	unsigned long	rx_crc_errors;
26
-+	unsigned long	rx_frame_errors;
27
-+	unsigned long	rx_fifo_errors;
28
-+	unsigned long	rx_missed_errors;
29
-+	unsigned long	tx_aborted_errors;
30
-+	unsigned long	tx_carrier_errors;
31
-+	unsigned long	tx_fifo_errors;
32
-+	unsigned long	tx_heartbeat_errors;
33
-+	unsigned long	tx_window_errors;
34
-+	unsigned long	rx_compressed;
35
-+	unsigned long	tx_compressed;
36
-+};
37
-+#  define IFA_DATA net_device_stats
38
-+#  define IFA_RX_BYTES rx_bytes
39
-+#  define IFA_TX_BYTES tx_bytes
40
-+#  define IFA_RX_PACKT rx_packets
41
-+#  define IFA_TX_PACKT tx_packets
42
-+#  define IFA_RX_ERROR rx_errors
43
-+#  define IFA_TX_ERROR tx_errors
44
- #endif
45
- 
46
- 	struct IFA_DATA *if_data;

+ 0
- 21
utils/collectd/patches/150-fix-interface-af-link View File

@@ -1,21 +0,0 @@
1
---- a/src/interface.c
2
-+++ b/src/interface.c
3
-@@ -244,8 +244,8 @@ struct net_device_stats {
4
- 
5
- 	for (if_ptr = if_list; if_ptr != NULL; if_ptr = if_ptr->ifa_next)
6
- 	{
7
--		if (if_ptr->ifa_addr != NULL && if_ptr->ifa_addr->sa_family == AF_LINK) {
8
--			if_data = (struct IFA_DATA *) if_ptr->ifa_data;
9
-+		if ((if_data = (struct IFA_DATA *) if_ptr->ifa_data) == NULL)
10
-+			continue;
11
- 
12
- 			if_submit (if_ptr->ifa_name, "if_octets",
13
- 				if_data->IFA_RX_BYTES,
14
-@@ -256,7 +256,6 @@ struct net_device_stats {
15
- 			if_submit (if_ptr->ifa_name, "if_errors",
16
- 				if_data->IFA_RX_ERROR,
17
- 				if_data->IFA_TX_ERROR);
18
--		}
19
- 	}
20
- 
21
- 	freeifaddrs (if_list);