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/bsd/krt-sock.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sysdep/bsd') 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; -- cgit v1.2.3