summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-05-11 12:30:06 +0000
committerMartin Mares <mj@ucw.cz>2000-05-11 12:30:06 +0000
commit109c2f6cf350069c12abb7d182da6458ff56c1c7 (patch)
tree948c68e6f77316fe1f7d6b5c5aa5c05b8de3162c
parent2138d3b4d84058338ad4010eff8da62afa6531ab (diff)
If a broadcast address is missing, go fake one.
-rw-r--r--TODO2
-rw-r--r--sysdep/linux/netlink/netlink.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/TODO b/TODO
index f829e831..51802994 100644
--- a/TODO
+++ b/TODO
@@ -27,8 +27,6 @@ Core
- proto: Don't show repeated `Changed state to ...' messages if only internal states change
-- iface: Don't complain about missing broadcast addresses.
-
Documentation
~~~~~~~~~~~~~
- write doctool
diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c
index db744135..70abdd73 100644
--- a/sysdep/linux/netlink/netlink.c
+++ b/sysdep/linux/netlink/netlink.c
@@ -374,6 +374,7 @@ nl_parse_addr(struct nlmsghdr *h)
}
else
{
+ ip_addr netmask = ipa_mkmask(ifa.pxlen);
#ifndef IPV6
if (i->ifa_prefixlen == BITS_PER_IP_ADDRESS - 2)
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));
ipa_ntoh(ifa.brd);
}
+ else
+ ifa.brd = ipa_or(ifa.ip, ipa_not(netmask));
#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",