netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Cong Wang <amwang@redhat.com>
Cc: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
	"Herbert Xu" <herbert@gondor.hengli.com.au>,
	"Michal Kubeček" <mkubecek@suse.cz>,
	"David Miller" <davem@davemloft.net>,
	"Patrick McHardy" <kaber@trash.net>
Subject: Re: [PATCH 1/4] ipv6: add a new namespace for nf_conntrack_reasm
Date: Tue, 18 Sep 2012 17:45:09 +0200	[thread overview]
Message-ID: <20120918154509.GA19508@1984> (raw)
In-Reply-To: <1347975911-5655-2-git-send-email-amwang@redhat.com>

On Tue, Sep 18, 2012 at 09:45:08PM +0800, Cong Wang wrote:
> As pointed by Michal, it is necessary to add a new
> namespace for nf_conntrack_reasm code, this prepares
> for the second patch.
> 
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: Michal Kubeček <mkubecek@suse.cz>
> Cc: David Miller <davem@davemloft.net>
> Cc: Patrick McHardy <kaber@trash.net>
> Cc: Pablo Neira Ayuso <pablo@netfilter.org>
> Cc: netfilter-devel@vger.kernel.org
> Signed-off-by: Cong Wang <amwang@redhat.com>
> ---
>  include/net/net_namespace.h             |    3 +
>  include/net/netns/ipv6.h                |    8 ++
>  net/ipv6/netfilter/nf_conntrack_reasm.c |  135 +++++++++++++++++++++----------
>  3 files changed, 104 insertions(+), 42 deletions(-)
> 
> diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
> index 5ae57f1..d61e2b3 100644
> --- a/include/net/net_namespace.h
> +++ b/include/net/net_namespace.h
> @@ -93,6 +93,9 @@ struct net {
>  #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
>  	struct netns_ct		ct;
>  #endif
> +#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
> +	struct netns_nf_frag	nf_frag;
> +#endif
>  	struct sock		*nfnl;
>  	struct sock		*nfnl_stash;
>  #endif
> diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
> index 0318104..214cb0a 100644
> --- a/include/net/netns/ipv6.h
> +++ b/include/net/netns/ipv6.h
> @@ -71,4 +71,12 @@ struct netns_ipv6 {
>  #endif
>  #endif
>  };
> +
> +#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
> +struct netns_nf_frag {
> +	struct netns_sysctl_ipv6 sysctl;
> +	struct netns_frags	frags;
> +};
> +#endif
> +
>  #endif
> diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
> index f94fb3a..d28c067 100644
> --- a/net/ipv6/netfilter/nf_conntrack_reasm.c
> +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
> @@ -71,27 +71,26 @@ struct nf_ct_frag6_queue
>  };
>  
>  static struct inet_frags nf_frags;
> -static struct netns_frags nf_init_frags;
>  
>  #ifdef CONFIG_SYSCTL
>  static struct ctl_table nf_ct_frag6_sysctl_table[] = {
>  	{
>  		.procname	= "nf_conntrack_frag6_timeout",
> -		.data		= &nf_init_frags.timeout,
> +		.data		= &init_net.nf_frag.frags.timeout,
>  		.maxlen		= sizeof(unsigned int),
>  		.mode		= 0644,
>  		.proc_handler	= proc_dointvec_jiffies,
>  	},
>  	{
>  		.procname	= "nf_conntrack_frag6_low_thresh",
> -		.data		= &nf_init_frags.low_thresh,
> +		.data		= &init_net.nf_frag.frags.low_thresh,
>  		.maxlen		= sizeof(unsigned int),
>  		.mode		= 0644,
>  		.proc_handler	= proc_dointvec,
>  	},
>  	{
>  		.procname	= "nf_conntrack_frag6_high_thresh",
> -		.data		= &nf_init_frags.high_thresh,
> +		.data		= &init_net.nf_frag.frags.high_thresh,
>  		.maxlen		= sizeof(unsigned int),
>  		.mode		= 0644,
>  		.proc_handler	= proc_dointvec,
> @@ -99,7 +98,54 @@ static struct ctl_table nf_ct_frag6_sysctl_table[] = {
>  	{ }
>  };
>  
> -static struct ctl_table_header *nf_ct_frag6_sysctl_header;
> +static int __net_init nf_ct_frag6_sysctl_register(struct net *net)
> +{
> +	struct ctl_table *table;
> +	struct ctl_table_header *hdr;
> +
> +	table = nf_ct_frag6_sysctl_table;
> +	if (!net_eq(net, &init_net)) {
> +		table = kmemdup(table, sizeof(nf_ct_frag6_sysctl_table), GFP_KERNEL);

Sorry, you have to break lines at 80 chars.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-09-18 15:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18 13:45 [PATCH v3 net-next 0/4] ipv6: fix the reassembly expire code in nf_conntrack Cong Wang
2012-09-18 13:45 ` [PATCH 1/4] ipv6: add a new namespace for nf_conntrack_reasm Cong Wang
2012-09-18 15:45   ` Pablo Neira Ayuso [this message]
2012-09-19  1:54     ` Cong Wang
2012-09-18 13:45 ` [PATCH 2/4] ipv6: unify conntrack reassembly expire code with standard one Cong Wang
2012-09-18 13:45 ` [PATCH 3/4] ipv6: make ip6_frag_nqueues() and ip6_frag_mem() static inline Cong Wang
2012-09-18 13:45 ` [PATCH 4/4] ipv6: unify fragment thresh handling code Cong Wang
  -- strict thread matches above, loose matches on Subject: below --
2012-09-19  2:50 [PATCH v4 net-next 0/4] ipv6: fix the reassembly expire code in nf_conntrack Cong Wang
2012-09-19  2:50 ` [PATCH 1/4] ipv6: add a new namespace for nf_conntrack_reasm Cong Wang
2012-09-18  4:29 [PATCH v2 net-next 0/4] ipv6: fix the reassembly expire code in nf_conntrack Cong Wang
2012-09-18  4:29 ` [PATCH 1/4] ipv6: add a new namespace for nf_conntrack_reasm Cong Wang
2012-09-18  7:37   ` Pablo Neira Ayuso
2012-09-18 10:44     ` Cong Wang
2012-09-13  6:25 [PATCH net-next 0/4] ipv6: fix the reassembly expire code in nf_conntrack Cong Wang
2012-09-13  6:25 ` [PATCH 1/4] ipv6: add a new namespace for nf_conntrack_reasm Cong Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120918154509.GA19508@1984 \
    --to=pablo@netfilter.org \
    --cc=amwang@redhat.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.hengli.com.au \
    --cc=kaber@trash.net \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).