]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.35/ip6_tunnel-match-to-arphrd_tunnel6-for-dev-type.patch
Linux 4.19.35
[thirdparty/kernel/stable-queue.git] / releases / 4.19.35 / ip6_tunnel-match-to-arphrd_tunnel6-for-dev-type.patch
CommitLineData
a9fba688
SL
1From 282267f95290afe29fdaa407944ff5386679fcc8 Mon Sep 17 00:00:00 2001
2From: Sheena Mira-ato <sheena.mira-ato@alliedtelesis.co.nz>
3Date: Mon, 1 Apr 2019 13:04:42 +1300
4Subject: ip6_tunnel: Match to ARPHRD_TUNNEL6 for dev type
5
6[ Upstream commit b2e54b09a3d29c4db883b920274ca8dca4d9f04d ]
7
8The device type for ip6 tunnels is set to
9ARPHRD_TUNNEL6. However, the ip4ip6_err function
10is expecting the device type of the tunnel to be
11ARPHRD_TUNNEL. Since the device types do not
12match, the function exits and the ICMP error
13packet is not sent to the originating host. Note
14that the device type for IPv4 tunnels is set to
15ARPHRD_TUNNEL.
16
17Fix is to expect a tunnel device type of
18ARPHRD_TUNNEL6 instead. Now the tunnel device
19type matches and the ICMP error packet is sent
20to the originating host.
21
22Signed-off-by: Sheena Mira-ato <sheena.mira-ato@alliedtelesis.co.nz>
23Signed-off-by: David S. Miller <davem@davemloft.net>
24Signed-off-by: Sasha Levin <sashal@kernel.org>
25---
26 net/ipv6/ip6_tunnel.c | 4 ++--
27 1 file changed, 2 insertions(+), 2 deletions(-)
28
29diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
30index 0c6403cf8b52..ade1390c6348 100644
31--- a/net/ipv6/ip6_tunnel.c
32+++ b/net/ipv6/ip6_tunnel.c
33@@ -627,7 +627,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
34 rt = ip_route_output_ports(dev_net(skb->dev), &fl4, NULL,
35 eiph->daddr, eiph->saddr, 0, 0,
36 IPPROTO_IPIP, RT_TOS(eiph->tos), 0);
37- if (IS_ERR(rt) || rt->dst.dev->type != ARPHRD_TUNNEL) {
38+ if (IS_ERR(rt) || rt->dst.dev->type != ARPHRD_TUNNEL6) {
39 if (!IS_ERR(rt))
40 ip_rt_put(rt);
41 goto out;
42@@ -636,7 +636,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
43 } else {
44 if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos,
45 skb2->dev) ||
46- skb_dst(skb2)->dev->type != ARPHRD_TUNNEL)
47+ skb_dst(skb2)->dev->type != ARPHRD_TUNNEL6)
48 goto out;
49 }
50
51--
522.19.1
53