diff options
author | Patrick McHardy <kaber@trash.net> | 2007-02-12 11:14:11 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-02-12 11:14:11 -0800 |
commit | 982d9a9ce389c396bc83ce29d799937f379ddcb7 (patch) | |
tree | 5f470babe5eafa37aac006bc87a1fab31db80114 /net/netfilter | |
parent | 6b48a7d08d1bb2e3932bce1662fe411304acc18f (diff) | |
download | linux-982d9a9ce389c396bc83ce29d799937f379ddcb7.tar.gz linux-982d9a9ce389c396bc83ce29d799937f379ddcb7.tar.bz2 linux-982d9a9ce389c396bc83ce29d799937f379ddcb7.zip |
[NETFILTER]: nf_conntrack: properly use RCU for nf_conntrack_destroyed callback
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index d59640e2377b..0cc150560fb7 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -318,6 +318,7 @@ destroy_conntrack(struct nf_conntrack *nfct) struct nf_conn_help *help = nfct_help(ct); struct nf_conntrack_l3proto *l3proto; struct nf_conntrack_l4proto *l4proto; + typeof(nf_conntrack_destroyed) destroyed; DEBUGP("destroy_conntrack(%p)\n", ct); NF_CT_ASSERT(atomic_read(&nfct->use) == 0); @@ -341,10 +342,12 @@ destroy_conntrack(struct nf_conntrack *nfct) ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.protonum); if (l4proto && l4proto->destroy) l4proto->destroy(ct); - rcu_read_unlock(); - if (nf_conntrack_destroyed) - nf_conntrack_destroyed(ct); + destroyed = rcu_dereference(nf_conntrack_destroyed); + if (destroyed) + destroyed(ct); + + rcu_read_unlock(); write_lock_bh(&nf_conntrack_lock); /* Expectations will have been removed in clean_from_lists, |