summaryrefslogtreecommitdiffstats
path: root/sysdep/linux
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-04-28 00:39:57 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-04-28 00:39:57 +0200
commitba321706578de8402d50214a9e79a65835cdd821 (patch)
treea76b5e241ed7f7c698890f2f9fd26a3c35ed07b2 /sysdep/linux
parent48b0814ace2d05f9fef093d9f309bfa186a6f365 (diff)
downloadbird-ba321706578de8402d50214a9e79a65835cdd821.tar
bird-ba321706578de8402d50214a9e79a65835cdd821.zip
Better support for /31 networks.
Diffstat (limited to 'sysdep/linux')
-rw-r--r--sysdep/linux/netlink/netlink.c6
1 files changed, 5 insertions, 1 deletions
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;