mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-03-23 23:07:04 +00:00
Merge commit 'f515e22924591542a909db0deb8545386aaa576e' into integrated
Conflicts: sysdep/bsd/krt-sock.c
This commit is contained in:
commit
7b8adb3cb7
@ -753,29 +753,37 @@ 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 */
|
/* Clean up embedded interface ID returned in link-local address */
|
||||||
if (scope & SCOPE_LINK)
|
if (ipa_is_link_local(ifa.ip))
|
||||||
_I0(ifa.ip) = 0xfe800000;
|
_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
|
||||||
|
|
||||||
if ((iface->flags & IF_MULTIACCESS) || (masklen != maxlen))
|
if (masklen < maxlen)
|
||||||
{
|
{
|
||||||
ifa.prefix = ipa_and(ifa.ip, ipa_mkmask(masklen));
|
ifa.prefix = ipa_and(ifa.ip, ipa_mkmask(masklen));
|
||||||
|
|
||||||
if (masklen == maxlen)
|
|
||||||
ifa.flags |= IA_HOST;
|
|
||||||
|
|
||||||
if (masklen == (maxlen - 1))
|
if (masklen == (maxlen - 1))
|
||||||
ifa.opposite = ipa_opposite_m1(ifa.ip);
|
ifa.opposite = ipa_opposite_m1(ifa.ip);
|
||||||
|
|
||||||
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_MULTIACCESS))
|
||||||
|
ifa.opposite = ifa.brd;
|
||||||
}
|
}
|
||||||
else /* PtP iface */
|
else if (!(iface->flags & IF_MULTIACCESS) && ipa_nonzero(ifa.brd))
|
||||||
{
|
{
|
||||||
ifa.flags |= IA_PEER;
|
|
||||||
ifa.prefix = ifa.opposite = ifa.brd;
|
ifa.prefix = ifa.opposite = ifa.brd;
|
||||||
|
ifa.flags |= IA_PEER;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ifa.prefix = ifa.ip;
|
||||||
|
ifa.flags |= IA_HOST;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new)
|
if (new)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user