aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_ipt.c
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2014-02-11 20:07:33 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-12 19:23:32 -0500
commit4f1e9d8949b438c7791993515fc164312e9080e2 (patch)
treea41cb7eee0792da76d7f454a6852cfcdf2f49376 /net/sched/act_ipt.c
parenta5b5c958ffd1610545d6b4b8290aa9c5266d10fa (diff)
net_sched: act: move tcf_hashinfo_init() into tcf_register_action()
Cc: Jamal Hadi Salim <jhs@mojatatu.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_ipt.c')
-rw-r--r--net/sched/act_ipt.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 71f29f1b5a20..8a64a0734aee 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -29,7 +29,6 @@
29 29
30 30
31#define IPT_TAB_MASK 15 31#define IPT_TAB_MASK 15
32static struct tcf_hashinfo ipt_hash_info;
33 32
34static int ipt_init_target(struct xt_entry_target *t, char *table, unsigned int hook) 33static int ipt_init_target(struct xt_entry_target *t, char *table, unsigned int hook)
35{ 34{
@@ -262,7 +261,6 @@ nla_put_failure:
262 261
263static struct tc_action_ops act_ipt_ops = { 262static struct tc_action_ops act_ipt_ops = {
264 .kind = "ipt", 263 .kind = "ipt",
265 .hinfo = &ipt_hash_info,
266 .type = TCA_ACT_IPT, 264 .type = TCA_ACT_IPT,
267 .owner = THIS_MODULE, 265 .owner = THIS_MODULE,
268 .act = tcf_ipt, 266 .act = tcf_ipt,
@@ -273,7 +271,6 @@ static struct tc_action_ops act_ipt_ops = {
273 271
274static struct tc_action_ops act_xt_ops = { 272static struct tc_action_ops act_xt_ops = {
275 .kind = "xt", 273 .kind = "xt",
276 .hinfo = &ipt_hash_info,
277 .type = TCA_ACT_XT, 274 .type = TCA_ACT_XT,
278 .owner = THIS_MODULE, 275 .owner = THIS_MODULE,
279 .act = tcf_ipt, 276 .act = tcf_ipt,
@@ -289,20 +286,16 @@ MODULE_ALIAS("act_xt");
289 286
290static int __init ipt_init_module(void) 287static int __init ipt_init_module(void)
291{ 288{
292 int ret1, ret2, err; 289 int ret1, ret2;
293 err = tcf_hashinfo_init(&ipt_hash_info, IPT_TAB_MASK);
294 if (err)
295 return err;
296 290
297 ret1 = tcf_register_action(&act_xt_ops); 291 ret1 = tcf_register_action(&act_xt_ops, IPT_TAB_MASK);
298 if (ret1 < 0) 292 if (ret1 < 0)
299 printk("Failed to load xt action\n"); 293 printk("Failed to load xt action\n");
300 ret2 = tcf_register_action(&act_ipt_ops); 294 ret2 = tcf_register_action(&act_ipt_ops, IPT_TAB_MASK);
301 if (ret2 < 0) 295 if (ret2 < 0)
302 printk("Failed to load ipt action\n"); 296 printk("Failed to load ipt action\n");
303 297
304 if (ret1 < 0 && ret2 < 0) { 298 if (ret1 < 0 && ret2 < 0) {
305 tcf_hashinfo_destroy(&ipt_hash_info);
306 return ret1; 299 return ret1;
307 } else 300 } else
308 return 0; 301 return 0;
@@ -312,7 +305,6 @@ static void __exit ipt_cleanup_module(void)
312{ 305{
313 tcf_unregister_action(&act_xt_ops); 306 tcf_unregister_action(&act_xt_ops);
314 tcf_unregister_action(&act_ipt_ops); 307 tcf_unregister_action(&act_ipt_ops);
315 tcf_hashinfo_destroy(&ipt_hash_info);
316} 308}
317 309
318module_init(ipt_init_module); 310module_init(ipt_init_module);