aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6/in6_fib.c
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2020-03-03 09:45:16 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2020-03-03 09:45:16 +0000
commitf6428cdb1fbc5cf5d914f9b8d6f0db556e73b8a4 (patch)
tree5ff97dcbdd500d6616661d5eb10d126777053a97 /sys/netinet6/in6_fib.c
parent228b87bc31468008c29a39017ebfc1adb33d7a44 (diff)
downloadsrc-f6428cdb1fbc5cf5d914f9b8d6f0db556e73b8a4.tar.gz
src-f6428cdb1fbc5cf5d914f9b8d6f0db556e73b8a4.zip
fib6_rte_to_nh_*: return a link-local gw address with scope embedded
In fib6_rte_to_nh_* when returning a link-local gateway address currently we do clear the scope. That could be recovered using the ifp returned as well, but the code in general seems to expect a link-local address with scope embeedded as otherwise the "dst" (gw) passed to the output routines will not include scope and not send the packet out (the right interface). Do not clear the scope when returning a link-local address and allow packets to go out (the right interface). Remove the (now) extra scope recovery in the IPv6 fast-fwd code. Sponsored by: Netflix Reviewed by: melifaro, ae MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D23872
Notes
Notes: svn path=/head/; revision=358568
Diffstat (limited to 'sys/netinet6/in6_fib.c')
-rw-r--r--sys/netinet6/in6_fib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet6/in6_fib.c b/sys/netinet6/in6_fib.c
index 51b7467904c6..0f471394d3ea 100644
--- a/sys/netinet6/in6_fib.c
+++ b/sys/netinet6/in6_fib.c
@@ -115,9 +115,9 @@ fib6_rte_to_nh_basic(struct rtentry *rte, const struct in6_addr *dst,
pnh6->nh_mtu = min(rte->rt_mtu, IN6_LINKMTU(rte->rt_ifp));
if (rte->rt_flags & RTF_GATEWAY) {
+ /* Return address with embedded scope. */
gw = (struct sockaddr_in6 *)rte->rt_gateway;
pnh6->nh_addr = gw->sin6_addr;
- in6_clearscope(&pnh6->nh_addr);
} else
pnh6->nh_addr = *dst;
/* Set flags */
@@ -143,9 +143,9 @@ fib6_rte_to_nh_extended(struct rtentry *rte, const struct in6_addr *dst,
pnh6->nh_mtu = min(rte->rt_mtu, IN6_LINKMTU(rte->rt_ifp));
if (rte->rt_flags & RTF_GATEWAY) {
+ /* Return address with embedded scope. */
gw = (struct sockaddr_in6 *)rte->rt_gateway;
pnh6->nh_addr = gw->sin6_addr;
- in6_clearscope(&pnh6->nh_addr);
} else
pnh6->nh_addr = *dst;
/* Set flags */