From: Gao feng <gaofeng@cn.fujitsu.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: David Miller <davem@davemloft.net>,
wfg@linux.intel.com, netdev@vger.kernel.org
Subject: Re: net/netfilter/nf_conntrack_proto_tcp.c:1606:9: error: ‘struct nf_proto_net’ has no member named ‘user’
Date: Tue, 12 Jun 2012 09:46:06 +0800 [thread overview]
Message-ID: <4FD69F5E.3060900@cn.fujitsu.com> (raw)
In-Reply-To: <20120612002655.GA28155@1984>
于 2012年06月12日 08:26, Pablo Neira Ayuso 写道:
> Hi again David,
>
> On Mon, Jun 11, 2012 at 03:23:44PM -0700, David Miller wrote:
>> From: Pablo Neira Ayuso <pablo@netfilter.org>
>> Date: Tue, 12 Jun 2012 00:15:21 +0200
>>
>>> Could you please apply the following patch to net-next to resolve
>>> this? Thanks.
>>
>> Applied, but you have to be kidding me with those ifdefs.
>>
>> This is exactly the same kind of thing Gao suggested for
>> the inetpeer code recently and which I flat out rejected.
>>
>> You can't pepper foo.c files with ifdefs all over the place.
>
> Would you be OK if I send you patches to move all sysctl part of
> nf_conntrack_proto_*.c to nf_conntrack_proto_*_sysctl.c
>
> I can also do the same for nf_conntrack_proto.c.
>
> This means more files under the net/netfilter directory, but less
> ifdef kludges in the code.
>
> Please, have a look at the patch enclosed to this email in case you
> want to see how it would look like in the end with my proposal.
I am sorry for all the trouble aroused by my negligence.
> static int tcpv4_init_net(struct net *net)
> {
> int i;
> @@ -1600,11 +1373,7 @@ static int tcpv4_init_net(struct net *net)
> struct nf_tcp_net *tn = tcp_pernet(net);
> struct nf_proto_net *pn = (struct nf_proto_net *)tn;
>
> -#ifdef CONFIG_SYSCTL
> - if (!pn->ctl_table) {
> -#else
> if (!pn->users++) {
nf_proto_net.users has different meaning when SYSCTL enabled or disabled.
when SYSCTL enabled,it means if both tcpv4 and tcpv6 register the sysctl,
it is increased when register sysctl success and decreased when unregister sysctl.
we can regard it as the refcnt of ctl_table.
when SYSCTL disabled,it just used to identify if the proto's pernet data
has been initialized.
next prev parent reply other threads:[~2012-06-12 1:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-11 21:36 net/netfilter/nf_conntrack_proto_tcp.c:1606:9: error: ‘struct nf_proto_net’ has no member named ‘user’ wfg
2012-06-11 22:15 ` Pablo Neira Ayuso
2012-06-11 22:23 ` David Miller
2012-06-11 22:46 ` Pablo Neira Ayuso
2012-06-12 0:26 ` Pablo Neira Ayuso
2012-06-12 1:34 ` David Miller
2012-06-12 1:46 ` Gao feng [this message]
2012-06-12 9:29 ` Pablo Neira Ayuso
2012-06-12 11:03 ` Gao feng
2012-06-12 16:03 ` Pablo Neira Ayuso
2012-06-13 2:06 ` Gao feng
2012-06-13 8:51 ` Gao feng
2012-06-13 11:38 ` 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=4FD69F5E.3060900@cn.fujitsu.com \
--to=gaofeng@cn.fujitsu.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=wfg@linux.intel.com \
/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).