diff --git a/src/linux.cc b/src/linux.cc index 14b93148..c26c847f 100644 --- a/src/linux.cc +++ b/src/linux.cc @@ -578,11 +578,9 @@ void update_net_interfaces(FILE *net_dev_fp, bool is_first_update, for (unsigned int k = 0; k < conf.ifc_len / sizeof(struct ifreq); k++) { struct net_stat *ns2; - if (!(((struct ifreq *)conf.ifc_buf) + k)) break; - - ns2 = get_net_stat(((struct ifreq *)conf.ifc_buf)[k].ifr_ifrn.ifrn_name, + ns2 = get_net_stat(conf.ifc_req[k].ifr_ifrn.ifrn_name, nullptr, NULL); - ns2->addr = ((struct ifreq *)conf.ifc_buf)[k].ifr_ifru.ifru_addr; + ns2->addr = conf.ifc_req[k].ifr_ifru.ifru_addr; char temp_addr[18]; snprintf(temp_addr, sizeof(temp_addr), "%u.%u.%u.%u, ", ns2->addr.sa_data[2] & 255, ns2->addr.sa_data[3] & 255,