only return loopback and ethernet types in net_interface_list

This commit is contained in:
Doug MacEachern 2006-11-05 02:41:48 +00:00
parent c77dd61985
commit 72dcec2dde
1 changed files with 4 additions and 1 deletions

View File

@ -2295,9 +2295,12 @@ sigar_net_interface_list_get(sigar_t *sigar,
else if (ifr->dwType == MIB_IF_TYPE_LOOPBACK) {
sprintf(name, "lo%d", lo++);
}
else {
else if (ifr->dwType == MIB_IF_TYPE_ETHERNET) {
sprintf(name, "eth%d", eth++);
}
else {
continue; /*XXX*/
}
if (iflist) {
iflist->data[iflist->number++] = strdup(name);