diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2014-02-11 20:07:33 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-02-12 19:23:32 -0500 |
commit | 4f1e9d8949b438c7791993515fc164312e9080e2 (patch) | |
tree | a41cb7eee0792da76d7f454a6852cfcdf2f49376 /net/sched/act_nat.c | |
parent | a5b5c958ffd1610545d6b4b8290aa9c5266d10fa (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_nat.c')
-rw-r--r-- | net/sched/act_nat.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 9a3cb1d16d19..270a030d5fd0 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c | |||
@@ -31,8 +31,6 @@ | |||
31 | 31 | ||
32 | #define NAT_TAB_MASK 15 | 32 | #define NAT_TAB_MASK 15 |
33 | 33 | ||
34 | static struct tcf_hashinfo nat_hash_info; | ||
35 | |||
36 | static const struct nla_policy nat_policy[TCA_NAT_MAX + 1] = { | 34 | static const struct nla_policy nat_policy[TCA_NAT_MAX + 1] = { |
37 | [TCA_NAT_PARMS] = { .len = sizeof(struct tc_nat) }, | 35 | [TCA_NAT_PARMS] = { .len = sizeof(struct tc_nat) }, |
38 | }; | 36 | }; |
@@ -284,7 +282,6 @@ nla_put_failure: | |||
284 | 282 | ||
285 | static struct tc_action_ops act_nat_ops = { | 283 | static struct tc_action_ops act_nat_ops = { |
286 | .kind = "nat", | 284 | .kind = "nat", |
287 | .hinfo = &nat_hash_info, | ||
288 | .type = TCA_ACT_NAT, | 285 | .type = TCA_ACT_NAT, |
289 | .owner = THIS_MODULE, | 286 | .owner = THIS_MODULE, |
290 | .act = tcf_nat, | 287 | .act = tcf_nat, |
@@ -297,16 +294,12 @@ MODULE_LICENSE("GPL"); | |||
297 | 294 | ||
298 | static int __init nat_init_module(void) | 295 | static int __init nat_init_module(void) |
299 | { | 296 | { |
300 | int err = tcf_hashinfo_init(&nat_hash_info, NAT_TAB_MASK); | 297 | return tcf_register_action(&act_nat_ops, NAT_TAB_MASK); |
301 | if (err) | ||
302 | return err; | ||
303 | return tcf_register_action(&act_nat_ops); | ||
304 | } | 298 | } |
305 | 299 | ||
306 | static void __exit nat_cleanup_module(void) | 300 | static void __exit nat_cleanup_module(void) |
307 | { | 301 | { |
308 | tcf_unregister_action(&act_nat_ops); | 302 | tcf_unregister_action(&act_nat_ops); |
309 | tcf_hashinfo_destroy(&nat_hash_info); | ||
310 | } | 303 | } |
311 | 304 | ||
312 | module_init(nat_init_module); | 305 | module_init(nat_init_module); |