fix broadcast flag check

This commit is contained in:
Doug MacEachern 2006-11-05 20:21:29 +00:00
parent a73e93ae91
commit 0e277dd5d6
1 changed files with 6 additions and 5 deletions

View File

@ -2400,17 +2400,18 @@ sigar_net_interface_config_get(sigar_t *sigar,
ipaddr->dwMask);
if (ifr->dwType != MIB_IF_TYPE_LOOPBACK) {
long bcast = ipaddr->dwAddr & ipaddr->dwMask;
if (ipaddr->dwBCastAddr) {
long bcast =
ipaddr->dwAddr & ipaddr->dwMask;
bcast |= ~ipaddr->dwMask;
ifconfig->flags |= SIGAR_IFF_BROADCAST;
}
sigar_net_address_set(ifconfig->broadcast,
bcast);
}
}
}
/* hack for MS_LOOPBACK_ADAPTER */
if (strnEQ(name, NETIF_LA, sizeof(NETIF_LA)-1)) {