diff options
author | stephen hemminger <shemminger@vyatta.com> | 2010-07-22 14:45:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-25 00:04:20 -0400 |
commit | 3b87956ea645fb4de7e59c7d0aa94de04be72615 (patch) | |
tree | 0dde04e6dfad7cd76afbb31eff72a8f08a574a9c /include | |
parent | 76ac21f5ef30e46397e405695eb1240ff0955209 (diff) |
net sched: fix race in mirred device removal
This fixes hang when target device of mirred packet classifier
action is removed.
If a mirror or redirection action is configured to cause packets
to go to another device, the classifier holds a ref count, but was assuming
the adminstrator cleaned up all redirections before removing. The fix
is to add a notifier and cleanup during unregister.
The new list is implicitly protected by RTNL mutex because
it is held during filter add/delete as well as notifier.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/tc_act/tc_mirred.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/tc_act/tc_mirred.h b/include/net/tc_act/tc_mirred.h index ceac661cdfd5..cfe2943690ff 100644 --- a/include/net/tc_act/tc_mirred.h +++ b/include/net/tc_act/tc_mirred.h | |||
@@ -9,6 +9,7 @@ struct tcf_mirred { | |||
9 | int tcfm_ifindex; | 9 | int tcfm_ifindex; |
10 | int tcfm_ok_push; | 10 | int tcfm_ok_push; |
11 | struct net_device *tcfm_dev; | 11 | struct net_device *tcfm_dev; |
12 | struct list_head tcfm_list; | ||
12 | }; | 13 | }; |
13 | #define to_mirred(pc) \ | 14 | #define to_mirred(pc) \ |
14 | container_of(pc, struct tcf_mirred, common) | 15 | container_of(pc, struct tcf_mirred, common) |