net_interface_config does not have to bail w/o ip address
This commit is contained in:
parent
72dcec2dde
commit
e8302a72f3
|
@ -2352,10 +2352,7 @@ sigar_net_interface_config_get(sigar_t *sigar,
|
||||||
ifr->dwIndex,
|
ifr->dwIndex,
|
||||||
&ipaddr);
|
&ipaddr);
|
||||||
|
|
||||||
if (status != SIGAR_OK) {
|
if (status == SIGAR_OK) {
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
sigar_net_address_set(ifconfig->address,
|
sigar_net_address_set(ifconfig->address,
|
||||||
ipaddr->dwAddr);
|
ipaddr->dwAddr);
|
||||||
|
|
||||||
|
@ -2364,6 +2361,7 @@ sigar_net_interface_config_get(sigar_t *sigar,
|
||||||
|
|
||||||
sigar_net_address_set(ifconfig->broadcast,
|
sigar_net_address_set(ifconfig->broadcast,
|
||||||
ipaddr->dwBCastAddr);
|
ipaddr->dwBCastAddr);
|
||||||
|
}
|
||||||
|
|
||||||
/* hack for MS_LOOPBACK_ADAPTER */
|
/* hack for MS_LOOPBACK_ADAPTER */
|
||||||
if (strnEQ(name, NETIF_LA, sizeof(NETIF_LA)-1)) {
|
if (strnEQ(name, NETIF_LA, sizeof(NETIF_LA)-1)) {
|
||||||
|
@ -2377,8 +2375,10 @@ sigar_net_interface_config_get(sigar_t *sigar,
|
||||||
SIGAR_NIC_LOOPBACK);
|
SIGAR_NIC_LOOPBACK);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (ipaddr) {
|
||||||
ifconfig->flags |=
|
ifconfig->flags |=
|
||||||
SIGAR_IFF_BROADCAST|SIGAR_IFF_MULTICAST;
|
SIGAR_IFF_BROADCAST|SIGAR_IFF_MULTICAST;
|
||||||
|
}
|
||||||
|
|
||||||
SIGAR_SSTRCPY(ifconfig->type,
|
SIGAR_SSTRCPY(ifconfig->type,
|
||||||
SIGAR_NIC_ETHERNET);
|
SIGAR_NIC_ETHERNET);
|
||||||
|
|
Loading…
Reference in New Issue