If a broadcast address is missing, go fake one.
This commit is contained in:
parent
2138d3b4d8
commit
109c2f6cf3
2 changed files with 4 additions and 3 deletions
2
TODO
2
TODO
|
@ -27,8 +27,6 @@ Core
|
||||||
|
|
||||||
- proto: Don't show repeated `Changed state to ...' messages if only internal states change
|
- proto: Don't show repeated `Changed state to ...' messages if only internal states change
|
||||||
|
|
||||||
- iface: Don't complain about missing broadcast addresses.
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
- write doctool
|
- write doctool
|
||||||
|
|
|
@ -374,6 +374,7 @@ nl_parse_addr(struct nlmsghdr *h)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
ip_addr netmask = ipa_mkmask(ifa.pxlen);
|
||||||
#ifndef IPV6
|
#ifndef IPV6
|
||||||
if (i->ifa_prefixlen == BITS_PER_IP_ADDRESS - 2)
|
if (i->ifa_prefixlen == BITS_PER_IP_ADDRESS - 2)
|
||||||
ifa.opposite = ipa_opposite(ifa.ip);
|
ifa.opposite = ipa_opposite(ifa.ip);
|
||||||
|
@ -382,8 +383,10 @@ nl_parse_addr(struct nlmsghdr *h)
|
||||||
memcpy(&ifa.brd, RTA_DATA(a[IFA_BROADCAST]), sizeof(ifa.brd));
|
memcpy(&ifa.brd, RTA_DATA(a[IFA_BROADCAST]), sizeof(ifa.brd));
|
||||||
ipa_ntoh(ifa.brd);
|
ipa_ntoh(ifa.brd);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
ifa.brd = ipa_or(ifa.ip, ipa_not(netmask));
|
||||||
#endif
|
#endif
|
||||||
ifa.prefix = ipa_and(ifa.ip, ipa_mkmask(ifa.pxlen));
|
ifa.prefix = ipa_and(ifa.ip, netmask);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG("KIF: IF%d(%s): %s IPA %I, flg %x, net %I/%d, brd %I, opp %I\n",
|
DBG("KIF: IF%d(%s): %s IPA %I, flg %x, net %I/%d, brd %I, opp %I\n",
|
||||||
|
|
Loading…
Reference in a new issue