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 18:03:04 +0200 [thread overview]
Message-ID: <20120612160304.GA31427@1984> (raw)
In-Reply-To: <4FD72203.9090005@cn.fujitsu.com>
On Tue, Jun 12, 2012 at 07:03:31PM +0800, Gao feng wrote:
> 于 2012年06月12日 17:29, Pablo Neira Ayuso 写道:
>
> >> 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.
> >
> Hi David & Pablo
>
> Please have a look at this patch and tell me if it's OK.
> it base on Pable's patch.
I think we have to merge those tcpv4_init_net and tcpv6_init_net
functions into one single function tcp_init_net. Then, we can pass
l4proto->l3proto to init_net:
if (proto->init_net) {
ret = proto->init_net(net, l4proto->l3proto);
if (ret < 0)
return ret;
}
Thus, we can check if this is IPv4 or IPv6 and initialize the compat
part accordingly.
Still, we have that pn->users thing:
if (!pn->users++) {
for (i = 0; i < TCP_CONNTRACK_TIMEOUT_MAX; i++)
tn->timeouts[i] = tcp_timeouts[i];
tn->tcp_loose = nf_ct_tcp_loose;
tn->tcp_be_liberal = nf_ct_tcp_be_liberal;
tn->tcp_max_retrans = nf_ct_tcp_max_retrans;
}
Define some pn->initialized boolean. Set it to true at the end of
the new tcp_init_net.
Similar thing for other protocol trackers.
Let me know if you are going to send me patches. In that case, please
do it on top of the current tree.
Once that has been cleaned up, we can prepare follow-up patches to
move the sysctl code to nf_conntrack_proto_*_sysctl.c to reduce the
ifdef pollution.
next prev parent reply other threads:[~2012-06-12 16:03 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
2012-06-12 11:03 ` Gao feng
2012-06-12 16:03 ` Pablo Neira Ayuso [this message]
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=20120612160304.GA31427@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).