]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.35/ip6_tunnel-match-to-arphrd_tunnel6-for-dev-type.patch
Linux 4.14.112
[thirdparty/kernel/stable-queue.git] / releases / 4.19.35 / ip6_tunnel-match-to-arphrd_tunnel6-for-dev-type.patch
1 From 282267f95290afe29fdaa407944ff5386679fcc8 Mon Sep 17 00:00:00 2001
2 From: Sheena Mira-ato <sheena.mira-ato@alliedtelesis.co.nz>
3 Date: Mon, 1 Apr 2019 13:04:42 +1300
4 Subject: ip6_tunnel: Match to ARPHRD_TUNNEL6 for dev type
5
6 [ Upstream commit b2e54b09a3d29c4db883b920274ca8dca4d9f04d ]
7
8 The device type for ip6 tunnels is set to
9 ARPHRD_TUNNEL6. However, the ip4ip6_err function
10 is expecting the device type of the tunnel to be
11 ARPHRD_TUNNEL. Since the device types do not
12 match, the function exits and the ICMP error
13 packet is not sent to the originating host. Note
14 that the device type for IPv4 tunnels is set to
15 ARPHRD_TUNNEL.
16
17 Fix is to expect a tunnel device type of
18 ARPHRD_TUNNEL6 instead. Now the tunnel device
19 type matches and the ICMP error packet is sent
20 to the originating host.
21
22 Signed-off-by: Sheena Mira-ato <sheena.mira-ato@alliedtelesis.co.nz>
23 Signed-off-by: David S. Miller <davem@davemloft.net>
24 Signed-off-by: Sasha Levin <sashal@kernel.org>
25 ---
26 net/ipv6/ip6_tunnel.c | 4 ++--
27 1 file changed, 2 insertions(+), 2 deletions(-)
28
29 diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
30 index 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 --
52 2.19.1
53