summaryrefslogtreecommitdiffstats
path: root/sysdep/bsd/krt-sock.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-03-10 01:04:09 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-03-10 01:04:09 +0100
commitafa9f66c27e2f96b92059131def53cc7b2497705 (patch)
tree4d0f5092a18762dd0271ccb81109c966e72d47f8 /sysdep/bsd/krt-sock.c
parent53434e44a95fe9334f4bdf5e0da987929addffb1 (diff)
downloadbird-afa9f66c27e2f96b92059131def53cc7b2497705.tar
bird-afa9f66c27e2f96b92059131def53cc7b2497705.zip
Adds support for PTP links on BSD.
Diffstat (limited to 'sysdep/bsd/krt-sock.c')
-rw-r--r--sysdep/bsd/krt-sock.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c
index dac2c2e..1dd09ae 100644
--- a/sysdep/bsd/krt-sock.c
+++ b/sysdep/bsd/krt-sock.c
@@ -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