aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_mirred.c
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2013-12-20 03:08:51 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-20 17:06:27 -0500
commit568a153a22d8f338a5ebda70e6bd139f6d8bb2c3 (patch)
tree944006c1defc9335807ae15c30c466b5fb3f681f /net/sched/act_mirred.c
parent852ad5e631967ae2203cb08c5b6b42c26011ed63 (diff)
net_sched: fix a regression in tc actions
This patch fixes: 1) pass mask rather than size to tcf_hashinfo_init() 2) the cleanup should be in reversed order in mirred_cleanup_module() Reported-by: Eric Dumazet <eric.dumazet@gmail.com> Fixes: 369ba56787d7469c0afd ("net_sched: init struct tcf_hashinfo at register time") Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_mirred.c')
-rw-r--r--net/sched/act_mirred.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 199fc9838af3..9dbb8cd64cb0 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -276,7 +276,7 @@ static int __init mirred_init_module(void)
276 if (err) 276 if (err)
277 return err; 277 return err;
278 278
279 err = tcf_hashinfo_init(&mirred_hash_info, MIRRED_TAB_MASK+1); 279 err = tcf_hashinfo_init(&mirred_hash_info, MIRRED_TAB_MASK);
280 if (err) { 280 if (err) {
281 unregister_netdevice_notifier(&mirred_device_notifier); 281 unregister_netdevice_notifier(&mirred_device_notifier);
282 return err; 282 return err;
@@ -287,9 +287,9 @@ static int __init mirred_init_module(void)
287 287
288static void __exit mirred_cleanup_module(void) 288static void __exit mirred_cleanup_module(void)
289{ 289{
290 unregister_netdevice_notifier(&mirred_device_notifier);
291 tcf_hashinfo_destroy(&mirred_hash_info);
292 tcf_unregister_action(&act_mirred_ops); 290 tcf_unregister_action(&act_mirred_ops);
291 tcf_hashinfo_destroy(&mirred_hash_info);
292 unregister_netdevice_notifier(&mirred_device_notifier);
293} 293}
294 294
295module_init(mirred_init_module); 295module_init(mirred_init_module);