1 From 0a28cfd51e17f4f0a056bcf66bfbe492c3b99f38 Mon Sep 17 00:00:00 2001
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
6 From: zheng li <james.z.li@ericsson.com>
8 commit 0a28cfd51e17f4f0a056bcf66bfbe492c3b99f38 upstream.
10 There is an inconsistent conditional judgement in __ip_append_data and
11 ip_finish_output functions, the variable length in __ip_append_data just
12 include the length of application's payload and udp header, don't include
13 the length of ip header, but in ip_finish_output use
14 (skb->len > ip_skb_dst_mtu(skb)) as judgement, and skb->len include the
17 That causes some particular application's udp payload whose length is
18 between (MTU - IP Header) and MTU were fragmented by ip_fragment even
19 though the rst->dev support UFO feature.
21 Add the length of ip header to length in __ip_append_data to keep
22 consistent conditional judgement as ip_finish_output for ip fragment.
24 Signed-off-by: Zheng Li <james.z.li@ericsson.com>
25 Signed-off-by: David S. Miller <davem@davemloft.net>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 net/ipv4/ip_output.c | 2 +-
30 1 file changed, 1 insertion(+), 1 deletion(-)
32 --- a/net/ipv4/ip_output.c
33 +++ b/net/ipv4/ip_output.c
34 @@ -923,7 +923,7 @@ static int __ip_append_data(struct sock
36 cork->length += length;
37 if ((skb && skb_is_gso(skb)) ||
39 + (((length + fragheaderlen) > mtu) &&
40 (skb_queue_len(queue) <= 1) &&
41 (sk->sk_protocol == IPPROTO_UDP) &&
42 (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len &&