]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Adds support for PTP links on BSD.
authorOndrej Zajicek <santiago@crfreenet.org>
Wed, 10 Mar 2010 00:04:09 +0000 (01:04 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Wed, 10 Mar 2010 00:04:09 +0000 (01:04 +0100)
sysdep/bsd/krt-sock.c

index dac2c2e6090e034bb8ddd32f2822942771f7f347..1dd09ae9b55ae036ea01b8dc90ef0168dc7d5c5e 100644 (file)
@@ -508,9 +508,6 @@ krt_read_addr(struct ks_msg *msg)
   memcpy(&ifa.brd, &ibrd, sizeof(ip_addr));
 
   scope = ipa_classify(ifa.ip);
-
-  ifa.prefix = ipa_and(ifa.ip, ipa_mkmask(masklen));
-
   if (scope < 0)
   {
     log(L_ERR "KIF: Invalid interface address %I for %s", ifa.ip, iface->name);
@@ -518,6 +515,14 @@ krt_read_addr(struct ks_msg *msg)
   }
   ifa.scope = scope & IADDR_SCOPE_MASK;
 
+  if (iface->flags & IF_MULTIACCESS)
+    ifa.prefix = ipa_and(ifa.ip, ipa_mkmask(masklen));
+  else         /* PtP iface */
+  {
+    ifa.flags |= IA_UNNUMBERED;
+    ifa.prefix = ifa.opposite = ifa.brd;
+  }
+
   if (new)
     ifa_update(&ifa);
   else