diff options
author | David Ahern <dsahern@gmail.com> | 2018-07-19 12:41:18 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-28 07:57:15 +0200 |
commit | a46fa1c77d654306b0f3d4a6b32a54b0c1cfe29a (patch) | |
tree | 6701615fd5bb6c766174d6283a18f6c1d8e13787 /include | |
parent | a45dad6235f2f81ca8f605c6aa356967691b629c (diff) | |
download | linux-stable-a46fa1c77d654306b0f3d4a6b32a54b0c1cfe29a.tar.gz linux-stable-a46fa1c77d654306b0f3d4a6b32a54b0c1cfe29a.tar.bz2 linux-stable-a46fa1c77d654306b0f3d4a6b32a54b0c1cfe29a.zip |
net/ipv6: Fix linklocal to global address with VRF
[ Upstream commit 24b711edfc34bc45777a3f068812b7d1ed004a5d ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/tcp.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index c1ba68e45f20..9cf770150539 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -829,6 +829,11 @@ struct tcp_skb_cb { */ static inline int tcp_v6_iif(const struct sk_buff *skb) { + return TCP_SKB_CB(skb)->header.h6.iif; +} + +static inline int tcp_v6_iif_l3_slave(const struct sk_buff *skb) +{ bool l3_slave = ipv6_l3mdev_skb(TCP_SKB_CB(skb)->header.h6.flags); return l3_slave ? skb->skb_iif : TCP_SKB_CB(skb)->header.h6.iif; |