summaryrefslogtreecommitdiffstats
path: root/sysdep/bsd
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/bsd
parent48b0814ace2d05f9fef093d9f309bfa186a6f365 (diff)
downloadbird-ba321706578de8402d50214a9e79a65835cdd821.tar
bird-ba321706578de8402d50214a9e79a65835cdd821.zip
Better support for /31 networks.
Diffstat (limited to 'sysdep/bsd')
-rw-r--r--sysdep/bsd/krt-sock.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c
index 4817df3..12ebe6d 100644
--- a/sysdep/bsd/krt-sock.c
+++ b/sysdep/bsd/krt-sock.c
@@ -546,7 +546,17 @@ krt_read_addr(struct ks_msg *msg)
#endif
if (iface->flags & IF_MULTIACCESS)
+ {
ifa.prefix = ipa_and(ifa.ip, ipa_mkmask(masklen));
+
+ 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_m2(ifa.ip);
+#endif
+ }
else /* PtP iface */
{
ifa.flags |= IA_UNNUMBERED;