lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 12 Jun 2012 11:29:40 +0200
From:	Pablo Neira Ayuso <pablo@...filter.org>
To:	Gao feng <gaofeng@...fujitsu.com>
Cc:	David Miller <davem@...emloft.net>, wfg@...ux.intel.com,
	netdev@...r.kernel.org
Subject: Re: net/netfilter/nf_conntrack_proto_tcp.c:1606:9: error: ‘struct nf_proto_net’ has no member named ‘user’

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@...filter.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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists