netfilter: nf_conntrack: use l4proto->users as refcount for per-net data
authorGao feng <gaofeng@cn.fujitsu.com>
Thu, 21 Jun 2012 04:36:41 +0000 (04:36 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 27 Jun 2012 16:46:00 +0000 (18:46 +0200)
commitfa34fff5e69cc56eecf26754c9b57403899ebd0d
tree9d6500f577616a9a44081fe271ee94c6d5b566d3
parentf28997e27a03abc679f13824a0574b09112eea37
netfilter: nf_conntrack: use l4proto->users as refcount for per-net data

Currently, nf_proto_net's l4proto->users meaning is quite confusing
since it depends on the compilation tweaks.

To resolve this, we cleanup this code to regard it as the refcount
for l4proto's per-net data, since there may be two l4protos use the
same per-net data.

Thus, we increment pn->users when nf_conntrack_l4proto_register
successfully, and decrement it for nf_conntrack_l4_unregister case.

The users refcnt is not required form layer 3 protocol trackers.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_proto.c