+++ /dev/null
----
- src/interface.c | 33 ++++++++++++++++++++++++++++++++-
- 1 file changed, 32 insertions(+), 1 deletion(-)
-
---- a/src/interface.c
-+++ b/src/interface.c
-@@ -203,7 +203,38 @@ static int interface_read (void)
- # define IFA_RX_ERROR rx_errors
- # define IFA_TX_ERROR tx_errors
- #else
--# error "No suitable type for `struct ifaddrs->ifa_data' found."
-+struct net_device_stats {
-+ unsigned long rx_packets;
-+ unsigned long tx_packets;
-+ unsigned long rx_bytes;
-+ unsigned long tx_bytes;
-+ unsigned long rx_errors;
-+ unsigned long tx_errors;
-+ unsigned long rx_dropped;
-+ unsigned long tx_dropped;
-+ unsigned long multicast;
-+ unsigned long collisions;
-+ unsigned long rx_length_errors;
-+ unsigned long rx_over_errors;
-+ unsigned long rx_crc_errors;
-+ unsigned long rx_frame_errors;
-+ unsigned long rx_fifo_errors;
-+ unsigned long rx_missed_errors;
-+ unsigned long tx_aborted_errors;
-+ unsigned long tx_carrier_errors;
-+ unsigned long tx_fifo_errors;
-+ unsigned long tx_heartbeat_errors;
-+ unsigned long tx_window_errors;
-+ unsigned long rx_compressed;
-+ unsigned long tx_compressed;
-+};
-+# define IFA_DATA net_device_stats
-+# define IFA_RX_BYTES rx_bytes
-+# define IFA_TX_BYTES tx_bytes
-+# define IFA_RX_PACKT rx_packets
-+# define IFA_TX_PACKT tx_packets
-+# define IFA_RX_ERROR rx_errors
-+# define IFA_TX_ERROR tx_errors
- #endif
-
- struct IFA_DATA *if_data;
+++ /dev/null
---- a/src/interface.c
-+++ b/src/interface.c
-@@ -244,8 +244,8 @@ struct net_device_stats {
-
- for (if_ptr = if_list; if_ptr != NULL; if_ptr = if_ptr->ifa_next)
- {
-- if (if_ptr->ifa_addr != NULL && if_ptr->ifa_addr->sa_family == AF_LINK) {
-- if_data = (struct IFA_DATA *) if_ptr->ifa_data;
-+ 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,
-@@ -256,7 +256,6 @@ struct net_device_stats {
- if_submit (if_ptr->ifa_name, "if_errors",
- if_data->IFA_RX_ERROR,
- if_data->IFA_TX_ERROR);
-- }
- }
-
- freeifaddrs (if_list);