mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[NETFILTER]: nf_conntrack: properly use RCU for nf_conntrack_destroyed callback
Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
6b48a7d08d
commit
982d9a9ce3
2 changed files with 10 additions and 6 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue