network: do not set broadcast if prefixlen is 31 or 32
After fe841414ef
, broadcast address is
also compared with existing one to determine whether the address is
foregin or not. So, the address object should not contain unnecessary
information.
Fixes #17803.
This commit is contained in:
parent
565147b7bb
commit
df8aa08642
|
@ -865,6 +865,7 @@ static int dhcp4_update_address(Link *link, bool announce) {
|
||||||
addr->cinfo.ifa_prefered = lifetime;
|
addr->cinfo.ifa_prefered = lifetime;
|
||||||
addr->cinfo.ifa_valid = lifetime;
|
addr->cinfo.ifa_valid = lifetime;
|
||||||
addr->prefixlen = prefixlen;
|
addr->prefixlen = prefixlen;
|
||||||
|
if (prefixlen <= 30)
|
||||||
addr->broadcast.s_addr = address.s_addr | ~netmask.s_addr;
|
addr->broadcast.s_addr = address.s_addr | ~netmask.s_addr;
|
||||||
SET_FLAG(addr->flags, IFA_F_NOPREFIXROUTE, !link_prefixroute(link));
|
SET_FLAG(addr->flags, IFA_F_NOPREFIXROUTE, !link_prefixroute(link));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue