netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Gao feng <gaofeng@cn.fujitsu.com>
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 11:29:40 +0200	[thread overview]
Message-ID: <20120612092940.GB30080@1984> (raw)
In-Reply-To: <4FD69F5E.3060900@cn.fujitsu.com>

On Tue, Jun 12, 2012 at 09:46:06AM +0800, Gao feng wrote:
> 于 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.

We have to use two different counters for this. The conditional
meaning of that variable is really confusing.

  reply	other threads:[~2012-06-12  9:29 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
2012-06-12  9:29         ` Pablo Neira Ayuso [this message]
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=20120612092940.GB30080@1984 \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=gaofeng@cn.fujitsu.com \
    --cc=netdev@vger.kernel.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).