]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-3.18/ip6_tunnel-match-to-arphrd_tunnel6-for-dev-type.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / queue-3.18 / ip6_tunnel-match-to-arphrd_tunnel6-for-dev-type.patch
1 From foo@baz Mon Apr 15 07:47:06 CEST 2019
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 From: Sheena Mira-ato <sheena.mira-ato@alliedtelesis.co.nz>
7
8 [ Upstream commit b2e54b09a3d29c4db883b920274ca8dca4d9f04d ]
9
10 The device type for ip6 tunnels is set to
11 ARPHRD_TUNNEL6. However, the ip4ip6_err function
12 is expecting the device type of the tunnel to be
13 ARPHRD_TUNNEL. Since the device types do not
14 match, the function exits and the ICMP error
15 packet is not sent to the originating host. Note
16 that the device type for IPv4 tunnels is set to
17 ARPHRD_TUNNEL.
18
19 Fix is to expect a tunnel device type of
20 ARPHRD_TUNNEL6 instead. Now the tunnel device
21 type matches and the ICMP error packet is sent
22 to the originating host.
23
24 Signed-off-by: Sheena Mira-ato <sheena.mira-ato@alliedtelesis.co.nz>
25 Signed-off-by: David S. Miller <davem@davemloft.net>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27 ---
28 net/ipv6/ip6_tunnel.c | 4 ++--
29 1 file changed, 2 insertions(+), 2 deletions(-)
30
31 --- a/net/ipv6/ip6_tunnel.c
32 +++ b/net/ipv6/ip6_tunnel.c
33 @@ -638,7 +638,7 @@ ip4ip6_err(struct sk_buff *skb, struct i
34 IPPROTO_IPIP,
35 RT_TOS(eiph->tos), 0);
36 if (IS_ERR(rt) ||
37 - rt->dst.dev->type != ARPHRD_TUNNEL) {
38 + rt->dst.dev->type != ARPHRD_TUNNEL6) {
39 if (!IS_ERR(rt))
40 ip_rt_put(rt);
41 goto out;
42 @@ -648,7 +648,7 @@ ip4ip6_err(struct sk_buff *skb, struct i
43 ip_rt_put(rt);
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