]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
528628f2eac7b4534cc877f053d0edcd45fdf331
[thirdparty/kernel/stable-queue.git] /
1 From foo@baz Fri Aug 4 13:34:53 PDT 2017
2 From: Zheng Li <james.z.li@ericsson.com>
3 Date: Wed, 28 Dec 2016 23:23:46 +0800
4 Subject: ipv6: Should use consistent conditional judgement for ip6 fragment between __ip6_append_data and ip6_finish_output
5
6 From: Zheng Li <james.z.li@ericsson.com>
7
8
9 [ Upstream commit e4c5e13aa45c23692e4acf56f0b3533f328199b2 ]
10
11 There is an inconsistent conditional judgement between __ip6_append_data
12 and ip6_finish_output functions, the variable length in __ip6_append_data
13 just include the length of application's payload and udp6 header, don't
14 include the length of ipv6 header, but in ip6_finish_output use
15 (skb->len > ip6_skb_dst_mtu(skb)) as judgement, and skb->len include the
16 length of ipv6 header.
17
18 That causes some particular application's udp6 payloads whose length are
19 between (MTU - IPv6 Header) and MTU were fragmented by ip6_fragment even
20 though the rst->dev support UFO feature.
21
22 Add the length of ipv6 header to length in __ip6_append_data to keep
23 consistent conditional judgement as ip6_finish_output for ip6 fragment.
24
25 Signed-off-by: Zheng Li <james.z.li@ericsson.com>
26 Signed-off-by: David S. Miller <davem@davemloft.net>
27 Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
28 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 ---
30 net/ipv6/ip6_output.c | 2 +-
31 1 file changed, 1 insertion(+), 1 deletion(-)
32
33 --- a/net/ipv6/ip6_output.c
34 +++ b/net/ipv6/ip6_output.c
35 @@ -1361,7 +1361,7 @@ emsgsize:
36 */
37
38 cork->length += length;
39 - if (((length > mtu) ||
40 + if ((((length + fragheaderlen) > mtu) ||
41 (skb && skb_is_gso(skb))) &&
42 (sk->sk_protocol == IPPROTO_UDP) &&
43 (rt->dst.dev->features & NETIF_F_UFO) &&