aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
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
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')
-rw-r--r--net/sched/act_csum.c2
-rw-r--r--net/sched/act_gact.c2
-rw-r--r--net/sched/act_ipt.c2
-rw-r--r--net/sched/act_mirred.c6
-rw-r--r--net/sched/act_nat.c2
-rw-r--r--net/sched/act_pedit.c2
-rw-r--r--net/sched/act_police.c2
-rw-r--r--net/sched/act_simple.c2
-rw-r--r--net/sched/act_skbedit.c2
9 files changed, 11 insertions, 11 deletions
diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c
index 5d350c57af3f..9cc6717c5f19 100644
--- a/net/sched/act_csum.c
+++ b/net/sched/act_csum.c
@@ -586,7 +586,7 @@ MODULE_LICENSE("GPL");
586 586
587static int __init csum_init_module(void) 587static int __init csum_init_module(void)
588{ 588{
589 int err = tcf_hashinfo_init(&csum_hash_info, CSUM_TAB_MASK+1); 589 int err = tcf_hashinfo_init(&csum_hash_info, CSUM_TAB_MASK);
590 if (err) 590 if (err)
591 return err; 591 return err;
592 592
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
index 1e6e0e765243..dea927343bf4 100644
--- a/net/sched/act_gact.c
+++ b/net/sched/act_gact.c
@@ -208,7 +208,7 @@ MODULE_LICENSE("GPL");
208 208
209static int __init gact_init_module(void) 209static int __init gact_init_module(void)
210{ 210{
211 int err = tcf_hashinfo_init(&gact_hash_info, GACT_TAB_MASK+1); 211 int err = tcf_hashinfo_init(&gact_hash_info, GACT_TAB_MASK);
212 if (err) 212 if (err)
213 return err; 213 return err;
214#ifdef CONFIG_GACT_PROB 214#ifdef CONFIG_GACT_PROB
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 8344380ebaf1..e13ecbbfe8c4 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -314,7 +314,7 @@ MODULE_ALIAS("act_xt");
314static int __init ipt_init_module(void) 314static int __init ipt_init_module(void)
315{ 315{
316 int ret1, ret2, err; 316 int ret1, ret2, err;
317 err = tcf_hashinfo_init(&ipt_hash_info, IPT_TAB_MASK+1); 317 err = tcf_hashinfo_init(&ipt_hash_info, IPT_TAB_MASK);
318 if (err) 318 if (err)
319 return err; 319 return err;
320 320
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);
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c
index 409fe7181c5f..921fea43fca2 100644
--- a/net/sched/act_nat.c
+++ b/net/sched/act_nat.c
@@ -310,7 +310,7 @@ MODULE_LICENSE("GPL");
310 310
311static int __init nat_init_module(void) 311static int __init nat_init_module(void)
312{ 312{
313 int err = tcf_hashinfo_init(&nat_hash_info, NAT_TAB_MASK+1); 313 int err = tcf_hashinfo_init(&nat_hash_info, NAT_TAB_MASK);
314 if (err) 314 if (err)
315 return err; 315 return err;
316 return tcf_register_action(&act_nat_ops); 316 return tcf_register_action(&act_nat_ops);
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index aa5347c1b9f1..e2520e90a10d 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -246,7 +246,7 @@ MODULE_LICENSE("GPL");
246 246
247static int __init pedit_init_module(void) 247static int __init pedit_init_module(void)
248{ 248{
249 int err = tcf_hashinfo_init(&pedit_hash_info, PEDIT_TAB_MASK+1); 249 int err = tcf_hashinfo_init(&pedit_hash_info, PEDIT_TAB_MASK);
250 if (err) 250 if (err)
251 return err; 251 return err;
252 return tcf_register_action(&act_pedit_ops); 252 return tcf_register_action(&act_pedit_ops);
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 7b23ab07c6cc..819a9a4d1987 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -396,7 +396,7 @@ static struct tc_action_ops act_police_ops = {
396static int __init 396static int __init
397police_init_module(void) 397police_init_module(void)
398{ 398{
399 int err = tcf_hashinfo_init(&police_hash_info, POL_TAB_MASK+1); 399 int err = tcf_hashinfo_init(&police_hash_info, POL_TAB_MASK);
400 if (err) 400 if (err)
401 return err; 401 return err;
402 err = tcf_register_action(&act_police_ops); 402 err = tcf_register_action(&act_police_ops);
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
index 2d7a0eb11c69..81aebc162e5c 100644
--- a/net/sched/act_simple.c
+++ b/net/sched/act_simple.c
@@ -203,7 +203,7 @@ MODULE_LICENSE("GPL");
203static int __init simp_init_module(void) 203static int __init simp_init_module(void)
204{ 204{
205 int err, ret; 205 int err, ret;
206 err = tcf_hashinfo_init(&simp_hash_info, SIMP_TAB_MASK+1); 206 err = tcf_hashinfo_init(&simp_hash_info, SIMP_TAB_MASK);
207 if (err) 207 if (err)
208 return err; 208 return err;
209 209
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c
index 90ed04a83cf3..aa0a4c056f31 100644
--- a/net/sched/act_skbedit.c
+++ b/net/sched/act_skbedit.c
@@ -203,7 +203,7 @@ MODULE_LICENSE("GPL");
203 203
204static int __init skbedit_init_module(void) 204static int __init skbedit_init_module(void)
205{ 205{
206 int err = tcf_hashinfo_init(&skbedit_hash_info, SKBEDIT_TAB_MASK+1); 206 int err = tcf_hashinfo_init(&skbedit_hash_info, SKBEDIT_TAB_MASK);
207 if (err) 207 if (err)
208 return err; 208 return err;
209 return tcf_register_action(&act_skbedit_ops); 209 return tcf_register_action(&act_skbedit_ops);