summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-12-07 22:50:55 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-12-09 05:58:32 +0100
commita0d2290cf82fc77b6497e08a1a69246e4084729d (patch)
tree585704a38c3a98f62d8430ca5b29223ddcfd4c40
parentb95254f5391542985202b64353c0d0dd6a28ecf7 (diff)
downloadbird-a0d2290cf82fc77b6497e08a1a69246e4084729d.tar
bird-a0d2290cf82fc77b6497e08a1a69246e4084729d.zip
BSD: Correctly read numbered v6 addresses on ptp interfaces
When using IPv6, unnumbered interfaces can have numbered IP addresses; one example are link-local addresses, which always have a prefix length of 64.
-rw-r--r--sysdep/bsd/krt-sock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c
index 1647c5e..b70f166 100644
--- a/sysdep/bsd/krt-sock.c
+++ b/sysdep/bsd/krt-sock.c
@@ -544,7 +544,11 @@ krt_read_addr(struct ks_msg *msg)
_I0(ifa.ip) = 0xfe800000;
#endif
+#ifdef IPV6
+ if ((iface->flags & IF_MULTIACCESS) || (masklen != BITS_PER_IP_ADDRESS))
+#else
if (iface->flags & IF_MULTIACCESS)
+#endif
{
ifa.prefix = ipa_and(ifa.ip, ipa_mkmask(masklen));