From patchwork Wed Nov 6 16:52:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 288968 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8F7482C008F for ; Thu, 7 Nov 2013 03:52:37 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751588Ab3KFQwb (ORCPT ); Wed, 6 Nov 2013 11:52:31 -0500 Received: from mail-ea0-f170.google.com ([209.85.215.170]:40011 "EHLO mail-ea0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753476Ab3KFQwa (ORCPT ); Wed, 6 Nov 2013 11:52:30 -0500 Received: by mail-ea0-f170.google.com with SMTP id q10so4205672eaj.15 for ; Wed, 06 Nov 2013 08:52:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hBBKDunjUbNBy5mR7AQFmxEK6fMP/uAyttjNRdh+hGw=; b=lHfLaMRPSEiIf2AnG0ne86g0zbG6yiOi3U2LFMlB+tQOyAXTB5usSICmzTcAW1hdid 3WZwfXuG07Of1vr5Oc9WjcZxxLEYaAbmQW1iTaAHh29zOA+xcn0pt+cFkZ4q0siPS86L 5pdhBbipOmpATjt2QcV5Anrm8MjArXLYTe6JEgohXUbjBJAJP2wHY47j0tUNILzQwKbO mfOjqH9TBuGi8bCQJNIPHpF1lPM9vUDbVAZkHsaKao1p6Q0CtEB6zbIDmiG3A7g2N+2c Abdlp1zXdSVQ+cVAGVPHVsSAfx8Lnffc3feoCg4R1nHr1cqsfHTQneuyXQS+6d9hlIR0 7jnQ== X-Gm-Message-State: ALoCoQlNJ0FVuuavWVL8rqMYsm+S/VZ6AwWQC2P91JBZwVp0NXzD/Q0Zr9/7vHtUqtbPMoO7pEW7 X-Received: by 10.14.198.197 with SMTP id v45mr4653212een.52.1383756748704; Wed, 06 Nov 2013 08:52:28 -0800 (PST) Received: from localhost (sun-0.pirko.cz. [84.16.102.25]) by mx.google.com with ESMTPSA id w6sm75921609eeo.12.2013.11.06.08.52.26 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Wed, 06 Nov 2013 08:52:28 -0800 (PST) From: Jiri Pirko To: netdev@vger.kernel.org Cc: davem@davemloft.net, pablo@netfilter.org, netfilter-devel@vger.kernel.org, yoshfuji@linux-ipv6.org, kadlec@blackhole.kfki.hu, kaber@trash.net, mleitner@redhat.com, kuznet@ms2.inr.ac.ru, jmorris@namei.org, wensong@linux-vs.org, horms@verge.net.au, ja@ssi.bg, edumazet@google.com, pshelar@nicira.com, jasowang@redhat.com, alexander.h.duyck@intel.com, fw@strlen.de Subject: [patch net-next 1/2] ip6_output: fragment outgoing reassembled skb properly Date: Wed, 6 Nov 2013 17:52:19 +0100 Message-Id: <1383756740-7392-2-git-send-email-jiri@resnulli.us> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1383756740-7392-1-git-send-email-jiri@resnulli.us> References: <1383756740-7392-1-git-send-email-jiri@resnulli.us> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org If reassembled packet would fit into outdev MTU, it is not fragmented according the original frag size and it is send as single big packet. The second case is if skb is gso. In that case fragmentation does not happen according to the original frag size. This patch fixes these. Signed-off-by: Jiri Pirko --- net/ipv6/ip6_output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 91fb4e8..5e31a90 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -125,7 +125,8 @@ static int ip6_finish_output2(struct sk_buff *skb) static int ip6_finish_output(struct sk_buff *skb) { if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) || - dst_allfrag(skb_dst(skb))) + dst_allfrag(skb_dst(skb)) || + (IP6CB(skb)->frag_max_size && skb->len > IP6CB(skb)->frag_max_size)) return ip6_fragment(skb, ip6_finish_output2); else return ip6_finish_output2(skb);