]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes link-local addresses on BSD.
authorOndrej Zajicek <santiago@crfreenet.org>
Fri, 2 Apr 2010 09:36:38 +0000 (11:36 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Fri, 2 Apr 2010 09:36:38 +0000 (11:36 +0200)
sysdep/bsd/krt-sock.c

index 1dd09ae9b55ae036ea01b8dc90ef0168dc7d5c5e..1a2cc9f27e9d8cd9c93e0ef53a7bfb3b696a1e25 100644 (file)
@@ -515,6 +515,14 @@ krt_read_addr(struct ks_msg *msg)
   }
   ifa.scope = scope & IADDR_SCOPE_MASK;
 
+  /* BSD returns some scope/interface ID as a part of link-local address */
+  if (scope == (IADDR_HOST | SCOPE_LINK))
+  {
+    /* Clean up that */
+    _I0(ifa.ip) = 0xfe800000;
+    _I1(ifa.ip) = 0x00000000;
+  }
+
   if (iface->flags & IF_MULTIACCESS)
     ifa.prefix = ipa_and(ifa.ip, ipa_mkmask(masklen));
   else         /* PtP iface */