History

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.

stephen hemminger committed 16 years ago

Commit 3b879561 parent 76ac21f2 files · +41 −3Browse files

Showing the changes to include/net (1 of 2 files). Show all

Unified · Split

include/net/tc_act/tc_mirred.h+1−0
@@ -9,6 +9,7 @@ struct tcf_mirred { · 8 unmodified lines
99 int tcfm_ifindex;
1010 int tcfm_ok_push;
1111 struct net_device *tcfm_dev;
12+ struct list_head tcfm_list;
1213 };
1314 #define to_mirred(pc) \
1415 container_of(pc, struct tcf_mirred, common)