Lines 1-36
Link Here
|
1 |
--- src/interface.c.orig 2014-01-05 00:36:58.000000000 +0400 |
1 |
--- src/interface.c.orig 2014-01-26 09:09:14.860391000 +0100 |
2 |
+++ src/interface.c 2014-01-05 00:45:10.000000000 +0400 |
2 |
+++ src/interface.c 2014-02-28 23:32:40.000000000 +0100 |
3 |
@@ -212,20 +212,19 @@ static int interface_read (void) |
3 |
@@ -212,21 +212,19 @@ |
4 |
return (-1); |
4 |
return (-1); |
5 |
|
5 |
|
6 |
for (if_ptr = if_list; if_ptr != NULL; if_ptr = if_ptr->ifa_next) |
6 |
for (if_ptr = if_list; if_ptr != NULL; if_ptr = if_ptr->ifa_next) |
7 |
- { |
7 |
- { |
8 |
- if ((if_data = (struct IFA_DATA *) if_ptr->ifa_data) == NULL) |
8 |
- if (if_ptr->ifa_addr != NULL && if_ptr->ifa_addr->sa_family == AF_LINK) { |
9 |
- continue; |
9 |
- if_data = (struct IFA_DATA *) if_ptr->ifa_data; |
10 |
- |
10 |
- |
11 |
- if_submit (if_ptr->ifa_name, "if_octets", |
11 |
- if_submit (if_ptr->ifa_name, "if_octets", |
12 |
- if_data->IFA_RX_BYTES, |
12 |
- if_data->IFA_RX_BYTES, |
13 |
- if_data->IFA_TX_BYTES); |
13 |
- if_data->IFA_TX_BYTES); |
14 |
- if_submit (if_ptr->ifa_name, "if_packets", |
14 |
- if_submit (if_ptr->ifa_name, "if_packets", |
15 |
- if_data->IFA_RX_PACKT, |
15 |
- if_data->IFA_RX_PACKT, |
16 |
- if_data->IFA_TX_PACKT); |
16 |
- if_data->IFA_TX_PACKT); |
17 |
- if_submit (if_ptr->ifa_name, "if_errors", |
17 |
- if_submit (if_ptr->ifa_name, "if_errors", |
18 |
- if_data->IFA_RX_ERROR, |
18 |
- if_data->IFA_RX_ERROR, |
19 |
- if_data->IFA_TX_ERROR); |
19 |
- if_data->IFA_TX_ERROR); |
|
|
20 |
- } |
20 |
- } |
21 |
- } |
21 |
+ if (if_ptr->ifa_addr != NULL && if_ptr->ifa_addr->sa_family == AF_LINK) { |
22 |
+ if (if_ptr->ifa_addr != NULL && if_ptr->ifa_addr->sa_family == AF_LINK) { |
22 |
+ if_data = (struct IFA_DATA *) if_ptr->ifa_data; |
23 |
+ if_data = (struct IFA_DATA *) if_ptr->ifa_data; |
23 |
+ |
24 |
+ |
24 |
+ if_submit (if_ptr->ifa_name, "if_octets", |
25 |
+ if_submit (if_ptr->ifa_name, "if_octets", |
25 |
+ if_data->IFA_RX_BYTES, |
26 |
+ if_data->IFA_RX_BYTES, |
26 |
+ if_data->IFA_TX_BYTES); |
27 |
+ if_data->IFA_TX_BYTES); |
27 |
+ if_submit (if_ptr->ifa_name, "if_packets", |
28 |
+ if_submit (if_ptr->ifa_name, "if_packets", |
28 |
+ if_data->IFA_RX_PACKT, |
29 |
+ if_data->IFA_RX_PACKT, |
29 |
+ if_data->IFA_TX_PACKT); |
30 |
+ if_data->IFA_TX_PACKT); |
30 |
+ if_submit (if_ptr->ifa_name, "if_errors", |
31 |
+ if_submit (if_ptr->ifa_name, "if_errors", |
31 |
+ if_data->IFA_RX_ERROR, |
32 |
+ if_data->IFA_RX_ERROR, |
32 |
+ if_data->IFA_TX_ERROR); |
33 |
+ if_data->IFA_TX_ERROR); |
33 |
+ } |
34 |
+ } |
34 |
|
35 |
|
35 |
freeifaddrs (if_list); |
36 |
freeifaddrs (if_list); |
36 |
/* #endif HAVE_GETIFADDRS */ |
37 |
/* #endif HAVE_GETIFADDRS */ |