summaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-02-12 11:14:11 -0800
committerDavid S. Miller <davem@davemloft.net>2007-02-12 11:14:11 -0800
commit982d9a9ce389c396bc83ce29d799937f379ddcb7 (patch)
tree5f470babe5eafa37aac006bc87a1fab31db80114 /net/ipv4
parent6b48a7d08d1bb2e3932bce1662fe411304acc18f (diff)
downloadlinux-3.10-982d9a9ce389c396bc83ce29d799937f379ddcb7.tar.gz
linux-3.10-982d9a9ce389c396bc83ce29d799937f379ddcb7.tar.bz2
linux-3.10-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/ipv4')
-rw-r--r--net/ipv4/netfilter/nf_nat_core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
index 5156d5d6c3b..2c01378d359 100644
--- a/net/ipv4/netfilter/nf_nat_core.c
+++ b/net/ipv4/netfilter/nf_nat_core.c
@@ -617,8 +617,8 @@ static int __init nf_nat_init(void)
}
/* FIXME: Man, this is a hack. <SIGH> */
- NF_CT_ASSERT(nf_conntrack_destroyed == NULL);
- nf_conntrack_destroyed = &nf_nat_cleanup_conntrack;
+ NF_CT_ASSERT(rcu_dereference(nf_conntrack_destroyed) == NULL);
+ rcu_assign_pointer(nf_conntrack_destroyed, nf_nat_cleanup_conntrack);
/* Initialize fake conntrack so that NAT will skip it */
nf_conntrack_untracked.status |= IPS_NAT_DONE_MASK;
@@ -642,7 +642,8 @@ static int clean_nat(struct nf_conn *i, void *data)
static void __exit nf_nat_cleanup(void)
{
nf_ct_iterate_cleanup(&clean_nat, NULL);
- nf_conntrack_destroyed = NULL;
+ rcu_assign_pointer(nf_conntrack_destroyed, NULL);
+ synchronize_rcu();
vfree(bysource);
nf_ct_l3proto_put(l3proto);
}