From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Gao feng <gaofeng@cn.fujitsu.com>
Cc: netfilter-devel@vger.kernel.org, kaber@trash.net,
canqunzhang@gmail.com, ebiederm@xmission.com
Subject: Re: [PATCH nf-next 10/11] netfilter: l3proto: refactor l3proto support for netns
Date: Wed, 23 Jan 2013 14:16:48 +0100 [thread overview]
Message-ID: <20130123131648.GJ13799@1984> (raw)
In-Reply-To: <1358842234-15005-10-git-send-email-gaofeng@cn.fujitsu.com>
On Tue, Jan 22, 2013 at 04:10:33PM +0800, Gao feng wrote:
> move the code that register/unregister l3proto
> to the module_init/exit context.
I have applied this with minor cosmetical changes:
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
> ---
> include/net/netfilter/nf_conntrack_l3proto.h | 19 +++++++++----
> net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 22 ++++++++++-----
> net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | 26 ++++++++++++------
> net/netfilter/nf_conntrack_proto.c | 37 +++++++++-----------------
> 4 files changed, 61 insertions(+), 43 deletions(-)
>
> diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h
> index 6f7c13f..b22605a 100644
> --- a/include/net/netfilter/nf_conntrack_l3proto.h
> +++ b/include/net/netfilter/nf_conntrack_l3proto.h
> @@ -76,11 +76,20 @@ struct nf_conntrack_l3proto {
>
> extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX];
>
> -/* Protocol registration. */
> -extern int nf_conntrack_l3proto_register(struct net *net,
> - struct nf_conntrack_l3proto *proto);
> -extern void nf_conntrack_l3proto_unregister(struct net *net,
> - struct nf_conntrack_l3proto *proto);
> +/* Protocol pernet registration. */
> +extern int
> +nf_conntrack_l3proto_pernet_register(struct net *net,
> + struct nf_conntrack_l3proto *proto);
I have renamed these functions from
nf_conntrack_l3proto_pernet_register to nf_ct_l3proto_pernet_register,
to avoid too long function names.
Similar changes to other registration/unregistration functions.
> +extern void
> +nf_conntrack_l3proto_pernet_unregister(struct net *net,
> + struct nf_conntrack_l3proto *proto);
> +
> +/* Protocol global registration. */
> +extern int
> +nf_conntrack_l3proto_register(struct nf_conntrack_l3proto *proto);
> +extern void
> +nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto);
> +
> extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto);
> extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p);
>
> diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
> index fcdd0c2..04799da 100644
> --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
> +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
> @@ -438,10 +438,10 @@ static int ipv4_net_init(struct net *net)
> pr_err("nf_conntrack_l4proto_icmp4 :protocol register failed\n");
> goto out_icmp;
> }
> - ret = nf_conntrack_l3proto_register(net,
> - &nf_conntrack_l3proto_ipv4);
> + ret = nf_conntrack_l3proto_pernet_register(net,
> + &nf_conntrack_l3proto_ipv4);
With the new shorter function naming, we save the extra line break in
all these registrations.
next prev parent reply other threads:[~2013-01-23 13:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-22 8:10 [PATCH nf-next 01/11] netfilter: move nf_conntrack initialize out of pernet operations Gao feng
2013-01-22 8:10 ` [PATCH nf-next 02/11] netfilter: expect: move initial codes out of pernet_operations Gao feng
2013-01-23 13:11 ` Pablo Neira Ayuso
2013-01-22 8:10 ` [PATCH nf-next 03/11] netfilter: acct: " Gao feng
2013-01-23 13:11 ` Pablo Neira Ayuso
2013-01-22 8:10 ` [PATCH nf-next 04/11] netfilter: tstamp: " Gao feng
2013-01-23 13:11 ` Pablo Neira Ayuso
2013-01-22 8:10 ` [PATCH nf-next 05/11] netfilter: ecache: " Gao feng
2013-01-23 13:11 ` Pablo Neira Ayuso
2013-01-22 8:10 ` [PATCH nf-next 06/11] netfilter: timeout: " Gao feng
2013-01-23 13:13 ` Pablo Neira Ayuso
2013-01-24 0:43 ` Gao feng
2013-01-22 8:10 ` [PATCH nf-next 07/11] netfilter: helper: " Gao feng
2013-01-23 13:14 ` Pablo Neira Ayuso
2013-01-22 8:10 ` [PATCH nf-next 08/11] netfilter: labels: " Gao feng
2013-01-23 13:14 ` Pablo Neira Ayuso
2013-01-22 8:10 ` [PATCH nf-next 09/11] netfilter: proto: " Gao feng
2013-01-23 13:14 ` Pablo Neira Ayuso
2013-01-22 8:10 ` [PATCH nf-next 10/11] netfilter: l3proto: refactor l3proto support for netns Gao feng
2013-01-23 13:16 ` Pablo Neira Ayuso [this message]
2013-01-22 8:10 ` [PATCH nf-next 11/11] netfilter: l4proto: refactor l4proto " Gao feng
2013-01-23 13:19 ` Pablo Neira Ayuso
2013-01-23 13:11 ` [PATCH nf-next 01/11] netfilter: move nf_conntrack initialize out of pernet operations Pablo Neira Ayuso
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=20130123131648.GJ13799@1984 \
--to=pablo@netfilter.org \
--cc=canqunzhang@gmail.com \
--cc=ebiederm@xmission.com \
--cc=gaofeng@cn.fujitsu.com \
--cc=kaber@trash.net \
--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).