From ba321706578de8402d50214a9e79a65835cdd821 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Wed, 28 Apr 2010 00:39:57 +0200 Subject: Better support for /31 networks. --- sysdep/linux/netlink/netlink.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sysdep/linux') diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c index aa0f2c4..72f06cc 100644 --- a/sysdep/linux/netlink/netlink.c +++ b/sysdep/linux/netlink/netlink.c @@ -390,9 +390,13 @@ nl_parse_addr(struct nlmsghdr *h) ip_addr netmask = ipa_mkmask(ifa.pxlen); ifa.prefix = ipa_and(ifa.ip, netmask); ifa.brd = ipa_or(ifa.ip, ipa_not(netmask)); + if (i->ifa_prefixlen == BITS_PER_IP_ADDRESS - 1) + ifa.opposite = ipa_opposite_m1(ifa.ip); + #ifndef IPV6 if (i->ifa_prefixlen == BITS_PER_IP_ADDRESS - 2) - ifa.opposite = ipa_opposite(ifa.ip, i->ifa_prefixlen); + ifa.opposite = ipa_opposite_m2(ifa.ip); + if ((ifi->flags & IF_BROADCAST) && a[IFA_BROADCAST]) { ip_addr xbrd; -- cgit v1.2.3