From patchwork Wed Jan 4 10:18:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Schillstrom X-Patchwork-Id: 134245 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EF0821007D6 for ; Wed, 4 Jan 2012 21:18:29 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752042Ab2ADKSW (ORCPT ); Wed, 4 Jan 2012 05:18:22 -0500 Received: from mailgw9.se.ericsson.net ([193.180.251.57]:44418 "EHLO mailgw9.se.ericsson.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862Ab2ADKSV (ORCPT ); Wed, 4 Jan 2012 05:18:21 -0500 X-AuditID: c1b4fb39-b7b3eae00000252a-68-4f04276b7ea4 Received: from esessmw0247.eemea.ericsson.se (Unknown_Domain [153.88.253.125]) by mailgw9.se.ericsson.net (Symantec Mail Security) with SMTP id 66.9D.09514.B67240F4; Wed, 4 Jan 2012 11:18:19 +0100 (CET) Received: from seasc0214.localnet (153.88.115.8) by esessmw0247.eemea.ericsson.se (153.88.115.94) with Microsoft SMTP Server id 8.3.137.0; Wed, 4 Jan 2012 11:18:19 +0100 From: Hans Schillstrom Organization: Ericsson AB To: Jozsef Kadlecsik Subject: Re: [PATCH 1/1] netfilter: Add possibility to turn off netfilters defrag per netns Date: Wed, 4 Jan 2012 11:18:17 +0100 User-Agent: KMail/1.10.3 (Linux/2.6.27.42-0.1-pae; KDE/4.1.3; i686; ; ) CC: Patrick McHardy , Pablo Neira Ayuso , "jengelh@medozas.de" , "netfilter-devel@vger.kernel.org" , "netdev@vger.kernel.org" , "hans@schillstrom.com" References: <1325664443-10320-1-git-send-email-hans.schillstrom@ericsson.com> <201201040949.54985.hans.schillstrom@ericsson.com> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-ID: <201201041118.18552.hans.schillstrom@ericsson.com> X-Brightmail-Tracker: AAAAAA== Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wednesday 04 January 2012 10:03:49 Jozsef Kadlecsik wrote: > On Wed, 4 Jan 2012, Hans Schillstrom wrote: > > > On Wednesday 04 January 2012 09:28:05 Jozsef Kadlecsik wrote: > > > > > > On Wed, 4 Jan 2012, Hans Schillstrom wrote: > > > > > > > In some cases it not desirable to have auto defrag. > > > > Ex. in a cluster where packets can arrive on different blades. > > > > In that case it is possible to use containers (LXC) and send > > > > all fragments to one place where defrag is enabled. > > > > > > > > This patch makes it possible to turn off the defrag per network name space, > > > > by setting net.netfilter.nf_conntrack_nodefrag to 1. > > > > Both IPv4 and IPv6 is effected by this sysctl. > > > > Default is 0 which is defrag. > > > > > > Conntrack assumes that the packets are defragmented and will drop any > > > unfragmented one. So your patch results packet drops. > > > > Hmmm, more work... > > > > > > Also, if you want to disable defragmentation then why don't you simply > > > "mark" the packets with the NOTRACK target? > > > > I don't think that will work since NF_IP_PRI_CONNTRACK_DEFRAG is -400 > > Then change NF_IP_PRI_RAW so that it precedes NF_IP_PRI_CONNTRACK_DEFRAG. > The raw table should be made possible to completely override conntack and > defrag is implicit part of the latter. > An other idea, turn off both conntrack and defrag i.e. do like NOTRAC and rename the flag ? Quick example for IPv4: --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/net/ipv4/netfilter/nf_defrag_ipv4.c +++ b/net/ipv4/netfilter/nf_defrag_ipv4.c @@ -74,6 +74,14 @@ static unsigned int ipv4_conntrack_defrag(unsigned int hooknum, ... + const struct net_device *dev = (hooknum == NF_INET_LOCAL_OUT ? + out : in); + + /* No defrag and not Previously seen (loopback)? */ + if (dev_net(dev)->ct.sysctl_notrac_defrag && skb->nfct) { + /* Attach fake conntrack entry. as in NOTRACK */ + skb->nfct = &nf_ct_untracked_get()->ct_general; + skb->nfctinfo = IP_CT_NEW; + nf_conntrack_get(skb->nfct); + return NF_ACCEPT; + } ... -- Regards Hans Schillstrom