projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
666b805
)
ipv4: take rtnl_lock and mark mrt table as freed on namespace cleanup
author
WANG Cong
<
[email protected]
>
Tue, 31 Mar 2015 18:01:45 +0000
(11:01 -0700)
committer
David S. Miller
<
[email protected]
>
Fri, 3 Apr 2015 00:52:34 +0000
(20:52 -0400)
This is the IPv4 part for commit
905a6f96a1b1
(ipv6: take rtnl_lock and mark mrt6 table as freed on namespace cleanup).
Cc: Hannes Frederic Sowa <
[email protected]
>
Acked-by: Hannes Frederic Sowa <
[email protected]
>
Signed-off-by: Cong Wang <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/ipv4/ipmr.c
patch
|
blob
|
history
diff --git
a/net/ipv4/ipmr.c
b/net/ipv4/ipmr.c
index 92825443fad6ea0f063fedfaa176761717fb739e..bc40115bc39481de40cd725356742c19f274c884 100644
(file)
--- a/
net/ipv4/ipmr.c
+++ b/
net/ipv4/ipmr.c
@@
-278,10
+278,12
@@
static void __net_exit ipmr_rules_exit(struct net *net)
{
struct mr_table *mrt, *next;
+ rtnl_lock();
list_for_each_entry_safe(mrt, next, &net->ipv4.mr_tables, list) {
list_del(&mrt->list);
ipmr_free_table(mrt);
}
+ rtnl_unlock();
fib_rules_unregister(net->ipv4.mr_rules_ops);
}
#else
@@
-308,7
+310,10
@@
static int __net_init ipmr_rules_init(struct net *net)
static void __net_exit ipmr_rules_exit(struct net *net)
{
+ rtnl_lock();
ipmr_free_table(net->ipv4.mrt);
+ net->ipv4.mrt = NULL;
+ rtnl_unlock();
}
#endif