]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
158ac701fba8cfd66dde8b82405052f6adf99f3d
[thirdparty/kernel/stable-queue.git] /
1 From foo@baz Wed Aug 9 12:42:27 PDT 2017
2 From: zheng li <james.z.li@ericsson.com>
3 Date: Mon, 12 Dec 2016 09:56:05 +0800
4 Subject: ipv4: Should use consistent conditional judgement for ip fragment in __ip_append_data and ip_finish_output
5
6 From: zheng li <james.z.li@ericsson.com>
7
8
9 [ Upstream commit 0a28cfd51e17f4f0a056bcf66bfbe492c3b99f38 ]
10
11 There is an inconsistent conditional judgement in __ip_append_data and
12 ip_finish_output functions, the variable length in __ip_append_data just
13 include the length of application's payload and udp header, don't include
14 the length of ip header, but in ip_finish_output use
15 (skb->len > ip_skb_dst_mtu(skb)) as judgement, and skb->len include the
16 length of ip header.
17
18 That causes some particular application's udp payload whose length is
19 between (MTU - IP Header) and MTU were fragmented by ip_fragment even
20 though the rst->dev support UFO feature.
21
22 Add the length of ip header to length in __ip_append_data to keep
23 consistent conditional judgement as ip_finish_output for ip 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/ipv4/ip_output.c | 2 +-
31 1 file changed, 1 insertion(+), 1 deletion(-)
32
33 --- a/net/ipv4/ip_output.c
34 +++ b/net/ipv4/ip_output.c
35 @@ -888,7 +888,7 @@ static int __ip_append_data(struct sock
36 csummode = CHECKSUM_PARTIAL;
37
38 cork->length += length;
39 - if (((length > mtu) || (skb && skb_is_gso(skb))) &&
40 + if ((((length + fragheaderlen) > mtu) || (skb && skb_is_gso(skb))) &&
41 (sk->sk_protocol == IPPROTO_UDP) &&
42 (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len &&
43 (sk->sk_type == SOCK_DGRAM)) {