0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

Merge commit '64534ea2f4361c247d7a0d1b6b14a02e8e3d6d33' into integrated

Conflicts:

	sysdep/bsd/krt-sock.c
This commit is contained in:
Ondrej Zajicek 2014-04-29 15:31:46 +02:00
commit 054bc43a5c

View File

@ -730,19 +730,20 @@ krt_read_addr(struct ks_msg *msg)
masklen = ipv4 ? (ip4_masklen(ipa_to_ip4(imask)) + 96) : ip6_masklen(&imask); // XXXX: Hack masklen = ipv4 ? (ip4_masklen(ipa_to_ip4(imask)) + 96) : ip6_masklen(&imask); // XXXX: Hack
if (masklen < 0) if (masklen < 0)
{ {
log("Invalid masklen"); log(L_ERR "KIF: Invalid masklen %I for %s", imask, iface->name);
return; return;
} }
// log("got %I/%I (%d)", iaddr, imask, masklen); /* Clean up embedded interface ID returned in link-local address */
if (ipa_is_link_local(ifa.ip))
_I0(iaddr) = 0xfe800000;
if (ipa_is_link_local(ifa.brd))
_I0(ibrd) = 0xfe800000;
bzero(&ifa, sizeof(ifa)); bzero(&ifa, sizeof(ifa));
ifa.iface = iface; ifa.iface = iface;
ifa.ip = iaddr;
memcpy(&ifa.ip, &iaddr, sizeof(ip_addr));
ifa.pxlen = masklen; ifa.pxlen = masklen;
memcpy(&ifa.brd, &ibrd, sizeof(ip_addr));
scope = ipa_classify(ifa.ip); scope = ipa_classify(ifa.ip);
if (scope < 0) if (scope < 0)
@ -752,13 +753,6 @@ krt_read_addr(struct ks_msg *msg)
} }
ifa.scope = scope & IADDR_SCOPE_MASK; ifa.scope = scope & IADDR_SCOPE_MASK;
/* Clean up embedded interface ID returned in link-local address */
if (ipa_is_link_local(ifa.ip))
_I0(ifa.ip) = 0xfe800000;
if (ipa_is_link_local(ifa.brd))
_I0(ifa.brd) = 0xfe800000;
// maxlen = ipv4 ? BITS_PER_IP_ADDRESS4 : BITS_PER_IP_ADDRESS6; // maxlen = ipv4 ? BITS_PER_IP_ADDRESS4 : BITS_PER_IP_ADDRESS6;
maxlen = BITS_PER_IP_ADDRESS; // XXXX: Hack maxlen = BITS_PER_IP_ADDRESS; // XXXX: Hack
@ -772,12 +766,15 @@ krt_read_addr(struct ks_msg *msg)
if (ipv4 && masklen == (maxlen - 2)) if (ipv4 && masklen == (maxlen - 2))
ifa.opposite = ipa_opposite_m2(ifa.ip); ifa.opposite = ipa_opposite_m2(ifa.ip);
if (iface->flags & IF_BROADCAST)
ifa.brd = ibrd;
if (!(iface->flags & IF_MULTIACCESS)) if (!(iface->flags & IF_MULTIACCESS))
ifa.opposite = ifa.brd; ifa.opposite = ibrd;
} }
else if (!(iface->flags & IF_MULTIACCESS) && ipa_nonzero(ifa.brd)) else if (!(iface->flags & IF_MULTIACCESS) && ipa_nonzero(ibrd))
{ {
ifa.prefix = ifa.opposite = ifa.brd; ifa.prefix = ifa.opposite = ibrd;
ifa.flags |= IA_PEER; ifa.flags |= IA_PEER;
} }
else else