You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
633 B

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