aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2018-07-19 15:41:18 -0400
committerDavid S. Miller <davem@davemloft.net>2018-07-21 22:31:46 -0400
commit24b711edfc34bc45777a3f068812b7d1ed004a5d (patch)
treef0a625917ab8381322b5bcdc271eaa8a26323002 /net/ipv6/tcp_ipv6.c
parentf95de8aa9f824d96421cb7ca81552b4ad8768a31 (diff)
net/ipv6: Fix linklocal to global address with VRF
Example setup: host: ip -6 addr add dev eth1 2001:db8:104::4 where eth1 is enslaved to a VRF switch: ip -6 ro add 2001:db8:104::4/128 dev br1 where br1 only has an LLA ping6 2001:db8:104::4 ssh 2001:db8:104::4 (NOTE: UDP works fine if the PKTINFO has the address set to the global address and ifindex is set to the index of eth1 with a destination an LLA). For ICMP, icmp6_iif needs to be updated to check if skb->dev is an L3 master. If it is then return the ifindex from rt6i_idev similar to what is done for loopback. For TCP, restore the original tcp_v6_iif definition which is needed in most places and add a new tcp_v6_iif_l3_slave that considers the l3_slave variability. This latter check is only needed for socket lookups. Fixes: 9ff74384600a ("net: vrf: Handle ipv6 multicast and link-local addresses") Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 7efa9fd7e109..03e6b7a2bc53 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -938,7 +938,8 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb)
938 &tcp_hashinfo, NULL, 0, 938 &tcp_hashinfo, NULL, 0,
939 &ipv6h->saddr, 939 &ipv6h->saddr,
940 th->source, &ipv6h->daddr, 940 th->source, &ipv6h->daddr,
941 ntohs(th->source), tcp_v6_iif(skb), 941 ntohs(th->source),
942 tcp_v6_iif_l3_slave(skb),
942 tcp_v6_sdif(skb)); 943 tcp_v6_sdif(skb));
943 if (!sk1) 944 if (!sk1)
944 goto out; 945 goto out;
@@ -1609,7 +1610,8 @@ do_time_wait:
1609 skb, __tcp_hdrlen(th), 1610 skb, __tcp_hdrlen(th),
1610 &ipv6_hdr(skb)->saddr, th->source, 1611 &ipv6_hdr(skb)->saddr, th->source,
1611 &ipv6_hdr(skb)->daddr, 1612 &ipv6_hdr(skb)->daddr,
1612 ntohs(th->dest), tcp_v6_iif(skb), 1613 ntohs(th->dest),
1614 tcp_v6_iif_l3_slave(skb),
1613 sdif); 1615 sdif);
1614 if (sk2) { 1616 if (sk2) {
1615 struct inet_timewait_sock *tw = inet_twsk(sk); 1617 struct inet_timewait_sock *tw = inet_twsk(sk);