From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Subject: Re: [PATCH] netfilter: define NF_CT_EXT_* as needed Date: Mon, 15 Nov 2010 12:20:43 +0100 Message-ID: <4CE1178B.6070108@trash.net> References: <1289813149-22897-1-git-send-email-xiaosuo@gmail.com> <4CE115C5.20302@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: "David S. Miller" , netfilter-devel@vger.kernel.org, netdev@vger.kernel.org To: Changli Gao Return-path: Received: from stinky.trash.net ([213.144.137.162]:62571 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932283Ab0KOLUn (ORCPT ); Mon, 15 Nov 2010 06:20:43 -0500 In-Reply-To: Sender: netfilter-devel-owner@vger.kernel.org List-ID: On 15.11.2010 12:19, Changli Gao wrote: > On Mon, Nov 15, 2010 at 7:13 PM, Patrick McHardy wrote: >> On 15.11.2010 10:25, Changli Gao wrote: >>> #ifdef CONFIG_NF_CONNTRACK_EVENTS >>> diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h >>> index 0772d29..1a9f96d 100644 >>> --- a/include/net/netfilter/nf_conntrack_extend.h >>> +++ b/include/net/netfilter/nf_conntrack_extend.h >>> @@ -7,10 +7,16 @@ >>> >>> enum nf_ct_ext_id { >>> NF_CT_EXT_HELPER, >>> +#if defined(CONFIG_NF_NAT) || defined(CONFIG_NF_NAT_MODULE) >>> NF_CT_EXT_NAT, >>> +#endif >>> NF_CT_EXT_ACCT, >>> +#ifdef CONFIG_NF_CONNTRACK_EVENTS >>> NF_CT_EXT_ECACHE, >>> +#endif >>> +#ifdef CONFIG_NF_CONNTRACK_ZONES >>> NF_CT_EXT_ZONE, >>> +#endif >>> NF_CT_EXT_NUM, >> >> What is the purpose of #ifdef'ing the extension IDs? >> > > struct nf_ct_ext { > struct rcu_head rcu; > u8 offset[NF_CT_EXT_NUM]; > u8 len; > char data[0]; > }; > > Less IDs make nf_ct_ext smaller. Right, thanks for the explanation.