fix broadcast flag check
This commit is contained in:
parent
a73e93ae91
commit
0e277dd5d6
|
@ -2400,15 +2400,16 @@ 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue