fix broadcast flag check
This commit is contained in:
parent
a73e93ae91
commit
0e277dd5d6
|
@ -2400,17 +2400,18 @@ sigar_net_interface_config_get(sigar_t *sigar,
|
||||||
ipaddr->dwMask);
|
ipaddr->dwMask);
|
||||||
|
|
||||||
if (ifr->dwType != MIB_IF_TYPE_LOOPBACK) {
|
if (ifr->dwType != MIB_IF_TYPE_LOOPBACK) {
|
||||||
long bcast = ipaddr->dwAddr & ipaddr->dwMask;
|
|
||||||
|
|
||||||
if (ipaddr->dwBCastAddr) {
|
if (ipaddr->dwBCastAddr) {
|
||||||
|
long bcast =
|
||||||
|
ipaddr->dwAddr & ipaddr->dwMask;
|
||||||
|
|
||||||
bcast |= ~ipaddr->dwMask;
|
bcast |= ~ipaddr->dwMask;
|
||||||
ifconfig->flags |= SIGAR_IFF_BROADCAST;
|
ifconfig->flags |= SIGAR_IFF_BROADCAST;
|
||||||
}
|
|
||||||
|
|
||||||
sigar_net_address_set(ifconfig->broadcast,
|
sigar_net_address_set(ifconfig->broadcast,
|
||||||
bcast);
|
bcast);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* 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)) {
|
||||||
|
|
Loading…
Reference in New Issue