Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764466AbcLTPqU (ORCPT ); Tue, 20 Dec 2016 10:46:20 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:38386 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764417AbcLTPqT (ORCPT ); Tue, 20 Dec 2016 10:46:19 -0500 Date: Tue, 20 Dec 2016 10:45:46 -0500 (EST) Message-Id: <20161220.104546.1863252338196704503.davem@davemloft.net> To: lizheng043@gmail.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@trash.net, james.z.li@ericsson.com Subject: Re: [PATCH v2] ipv4: Should use consistent conditional judgement for ip fragment in __ip_append_data and ip_finish_output From: David Miller In-Reply-To: <1481507765-3684-1-git-send-email-lizheng043@gmail.com> References: <1481507765-3684-1-git-send-email-lizheng043@gmail.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 20 Dec 2016 06:46:32 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 905 Lines: 22 From: Zheng Li Date: Mon, 12 Dec 2016 09:56:05 +0800 > From: zheng li > > There is an inconsistent conditional judgement in __ip_append_data and > ip_finish_output functions, the variable length in __ip_append_data just > include the length of application's payload and udp header, don't include > the length of ip header, but in ip_finish_output use > (skb->len > ip_skb_dst_mtu(skb)) as judgement, and skb->len include the > length of ip header. > > That causes some particular application's udp payload whose length is > between (MTU - IP Header) and MTU were fragmented by ip_fragment even > though the rst->dev support UFO feature. > > Add the length of ip header to length in __ip_append_data to keep > consistent conditional judgement as ip_finish_output for ip fragment. > > Signed-off-by: Zheng Li Applied, thanks.