diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2010-04-28 00:39:57 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2010-04-28 00:39:57 +0200 |
commit | ba321706578de8402d50214a9e79a65835cdd821 (patch) | |
tree | a76b5e241ed7f7c698890f2f9fd26a3c35ed07b2 /sysdep/bsd | |
parent | 48b0814ace2d05f9fef093d9f309bfa186a6f365 (diff) |
Better support for /31 networks.
Diffstat (limited to 'sysdep/bsd')
-rw-r--r-- | sysdep/bsd/krt-sock.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c index 4817df39..12ebe6de 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; |