Fix out-of-bounds address_v4::broadcast() return value on 64-bit systems.
This commit is contained in:
parent
6f783835d4
commit
0554900ad4
@ -140,7 +140,7 @@ bool address_v4::is_multicast() const
|
||||
|
||||
address_v4 address_v4::broadcast(const address_v4& addr, const address_v4& mask)
|
||||
{
|
||||
return address_v4(addr.to_ulong() | ~mask.to_ulong());
|
||||
return address_v4(addr.to_ulong() | (mask.to_ulong() ^ 0xFFFFFFFF));
|
||||
}
|
||||
|
||||
address_v4 address_v4::netmask(const address_v4& addr)
|
||||
|
Loading…
Reference in New Issue
Block a user