aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/act_api.h2
-rw-r--r--net/sched/act_api.c16
-rw-r--r--net/sched/act_csum.c8
-rw-r--r--net/sched/act_gact.c8
-rw-r--r--net/sched/act_ipt.c14
-rw-r--r--net/sched/act_mirred.c10
-rw-r--r--net/sched/act_nat.c9
-rw-r--r--net/sched/act_pedit.c9
-rw-r--r--net/sched/act_police.c13
-rw-r--r--net/sched/act_simple.c14
-rw-r--r--net/sched/act_skbedit.c8
11 files changed, 29 insertions, 82 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 3d22f42b6eec..969cac6344aa 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -107,7 +107,7 @@ int tcf_hash_create(u32 index, struct nlattr *est, struct tc_action *a,
107void tcf_hash_cleanup(struct tc_action *a, struct nlattr *est); 107void tcf_hash_cleanup(struct tc_action *a, struct nlattr *est);
108void tcf_hash_insert(struct tc_action *a); 108void tcf_hash_insert(struct tc_action *a);
109 109
110int tcf_register_action(struct tc_action_ops *a); 110int tcf_register_action(struct tc_action_ops *a, unsigned int mask);
111int tcf_unregister_action(struct tc_action_ops *a); 111int tcf_unregister_action(struct tc_action_ops *a);
112void tcf_action_destroy(struct list_head *actions, int bind); 112void tcf_action_destroy(struct list_head *actions, int bind);
113int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions, 113int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions,
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index a5bf9351ce5c..c88d382d3b09 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -275,9 +275,10 @@ EXPORT_SYMBOL(tcf_hash_insert);
275static LIST_HEAD(act_base); 275static LIST_HEAD(act_base);
276static DEFINE_RWLOCK(act_mod_lock); 276static DEFINE_RWLOCK(act_mod_lock);
277 277
278int tcf_register_action(struct tc_action_ops *act) 278int tcf_register_action(struct tc_action_ops *act, unsigned int mask)
279{ 279{
280 struct tc_action_ops *a; 280 struct tc_action_ops *a;
281 int err;
281 282
282 /* Must supply act, dump and init */ 283 /* Must supply act, dump and init */
283 if (!act->act || !act->dump || !act->init) 284 if (!act->act || !act->dump || !act->init)
@@ -289,10 +290,21 @@ int tcf_register_action(struct tc_action_ops *act)
289 if (!act->walk) 290 if (!act->walk)
290 act->walk = tcf_generic_walker; 291 act->walk = tcf_generic_walker;
291 292
293 act->hinfo = kmalloc(sizeof(struct tcf_hashinfo), GFP_KERNEL);
294 if (!act->hinfo)
295 return -ENOMEM;
296 err = tcf_hashinfo_init(act->hinfo, mask);
297 if (err) {
298 kfree(act->hinfo);
299 return err;
300 }
301
292 write_lock(&act_mod_lock); 302 write_lock(&act_mod_lock);
293 list_for_each_entry(a, &act_base, head) { 303 list_for_each_entry(a, &act_base, head) {
294 if (act->type == a->type || (strcmp(act->kind, a->kind) == 0)) { 304 if (act->type == a->type || (strcmp(act->kind, a->kind) == 0)) {
295 write_unlock(&act_mod_lock); 305 write_unlock(&act_mod_lock);
306 tcf_hashinfo_destroy(act->hinfo);
307 kfree(act->hinfo);
296 return -EEXIST; 308 return -EEXIST;
297 } 309 }
298 } 310 }
@@ -311,6 +323,8 @@ int tcf_unregister_action(struct tc_action_ops *act)
311 list_for_each_entry(a, &act_base, head) { 323 list_for_each_entry(a, &act_base, head) {
312 if (a == act) { 324 if (a == act) {
313 list_del(&act->head); 325 list_del(&act->head);
326 tcf_hashinfo_destroy(act->hinfo);
327 kfree(act->hinfo);
314 err = 0; 328 err = 0;
315 break; 329 break;
316 } 330 }
diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c
index 8df3060e7ac1..edbf40dac709 100644
--- a/net/sched/act_csum.c
+++ b/net/sched/act_csum.c
@@ -37,7 +37,6 @@
37#include <net/tc_act/tc_csum.h> 37#include <net/tc_act/tc_csum.h>
38 38
39#define CSUM_TAB_MASK 15 39#define CSUM_TAB_MASK 15
40static struct tcf_hashinfo csum_hash_info;
41 40
42static const struct nla_policy csum_policy[TCA_CSUM_MAX + 1] = { 41static const struct nla_policy csum_policy[TCA_CSUM_MAX + 1] = {
43 [TCA_CSUM_PARMS] = { .len = sizeof(struct tc_csum), }, 42 [TCA_CSUM_PARMS] = { .len = sizeof(struct tc_csum), },
@@ -561,7 +560,6 @@ nla_put_failure:
561 560
562static struct tc_action_ops act_csum_ops = { 561static struct tc_action_ops act_csum_ops = {
563 .kind = "csum", 562 .kind = "csum",
564 .hinfo = &csum_hash_info,
565 .type = TCA_ACT_CSUM, 563 .type = TCA_ACT_CSUM,
566 .owner = THIS_MODULE, 564 .owner = THIS_MODULE,
567 .act = tcf_csum, 565 .act = tcf_csum,
@@ -574,11 +572,7 @@ MODULE_LICENSE("GPL");
574 572
575static int __init csum_init_module(void) 573static int __init csum_init_module(void)
576{ 574{
577 int err = tcf_hashinfo_init(&csum_hash_info, CSUM_TAB_MASK); 575 return tcf_register_action(&act_csum_ops, CSUM_TAB_MASK);
578 if (err)
579 return err;
580
581 return tcf_register_action(&act_csum_ops);
582} 576}
583 577
584static void __exit csum_cleanup_module(void) 578static void __exit csum_cleanup_module(void)
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
index 094a1b509d75..d6bcbd9f7791 100644
--- a/net/sched/act_gact.c
+++ b/net/sched/act_gact.c
@@ -24,7 +24,6 @@
24#include <net/tc_act/tc_gact.h> 24#include <net/tc_act/tc_gact.h>
25 25
26#define GACT_TAB_MASK 15 26#define GACT_TAB_MASK 15
27static struct tcf_hashinfo gact_hash_info;
28 27
29#ifdef CONFIG_GACT_PROB 28#ifdef CONFIG_GACT_PROB
30static int gact_net_rand(struct tcf_gact *gact) 29static int gact_net_rand(struct tcf_gact *gact)
@@ -180,7 +179,6 @@ nla_put_failure:
180 179
181static struct tc_action_ops act_gact_ops = { 180static struct tc_action_ops act_gact_ops = {
182 .kind = "gact", 181 .kind = "gact",
183 .hinfo = &gact_hash_info,
184 .type = TCA_ACT_GACT, 182 .type = TCA_ACT_GACT,
185 .owner = THIS_MODULE, 183 .owner = THIS_MODULE,
186 .act = tcf_gact, 184 .act = tcf_gact,
@@ -194,21 +192,17 @@ MODULE_LICENSE("GPL");
194 192
195static int __init gact_init_module(void) 193static int __init gact_init_module(void)
196{ 194{
197 int err = tcf_hashinfo_init(&gact_hash_info, GACT_TAB_MASK);
198 if (err)
199 return err;
200#ifdef CONFIG_GACT_PROB 195#ifdef CONFIG_GACT_PROB
201 pr_info("GACT probability on\n"); 196 pr_info("GACT probability on\n");
202#else 197#else
203 pr_info("GACT probability NOT on\n"); 198 pr_info("GACT probability NOT on\n");
204#endif 199#endif
205 return tcf_register_action(&act_gact_ops); 200 return tcf_register_action(&act_gact_ops, GACT_TAB_MASK);
206} 201}
207 202
208static void __exit gact_cleanup_module(void) 203static void __exit gact_cleanup_module(void)
209{ 204{
210 tcf_unregister_action(&act_gact_ops); 205 tcf_unregister_action(&act_gact_ops);
211 tcf_hashinfo_destroy(&gact_hash_info);
212} 206}
213 207
214module_init(gact_init_module); 208module_init(gact_init_module);
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);
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 0f00eb96af84..4f912c0e225b 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -31,7 +31,6 @@
31 31
32#define MIRRED_TAB_MASK 7 32#define MIRRED_TAB_MASK 7
33static LIST_HEAD(mirred_list); 33static LIST_HEAD(mirred_list);
34static struct tcf_hashinfo mirred_hash_info;
35 34
36static void tcf_mirred_release(struct tc_action *a, int bind) 35static void tcf_mirred_release(struct tc_action *a, int bind)
37{ 36{
@@ -234,7 +233,6 @@ static struct notifier_block mirred_device_notifier = {
234 233
235static struct tc_action_ops act_mirred_ops = { 234static struct tc_action_ops act_mirred_ops = {
236 .kind = "mirred", 235 .kind = "mirred",
237 .hinfo = &mirred_hash_info,
238 .type = TCA_ACT_MIRRED, 236 .type = TCA_ACT_MIRRED,
239 .owner = THIS_MODULE, 237 .owner = THIS_MODULE,
240 .act = tcf_mirred, 238 .act = tcf_mirred,
@@ -253,19 +251,13 @@ static int __init mirred_init_module(void)
253 if (err) 251 if (err)
254 return err; 252 return err;
255 253
256 err = tcf_hashinfo_init(&mirred_hash_info, MIRRED_TAB_MASK);
257 if (err) {
258 unregister_netdevice_notifier(&mirred_device_notifier);
259 return err;
260 }
261 pr_info("Mirror/redirect action on\n"); 254 pr_info("Mirror/redirect action on\n");
262 return tcf_register_action(&act_mirred_ops); 255 return tcf_register_action(&act_mirred_ops, MIRRED_TAB_MASK);
263} 256}
264 257
265static void __exit mirred_cleanup_module(void) 258static void __exit mirred_cleanup_module(void)
266{ 259{
267 tcf_unregister_action(&act_mirred_ops); 260 tcf_unregister_action(&act_mirred_ops);
268 tcf_hashinfo_destroy(&mirred_hash_info);
269 unregister_netdevice_notifier(&mirred_device_notifier); 261 unregister_netdevice_notifier(&mirred_device_notifier);
270} 262}
271 263
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
34static struct tcf_hashinfo nat_hash_info;
35
36static const struct nla_policy nat_policy[TCA_NAT_MAX + 1] = { 34static 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
285static struct tc_action_ops act_nat_ops = { 283static 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
298static int __init nat_init_module(void) 295static 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
306static void __exit nat_cleanup_module(void) 300static 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
312module_init(nat_init_module); 305module_init(nat_init_module);
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 8aa795b275f2..5f9bcb2e080b 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -25,8 +25,6 @@
25 25
26#define PEDIT_TAB_MASK 15 26#define PEDIT_TAB_MASK 15
27 27
28static struct tcf_hashinfo pedit_hash_info;
29
30static const struct nla_policy pedit_policy[TCA_PEDIT_MAX + 1] = { 28static const struct nla_policy pedit_policy[TCA_PEDIT_MAX + 1] = {
31 [TCA_PEDIT_PARMS] = { .len = sizeof(struct tc_pedit) }, 29 [TCA_PEDIT_PARMS] = { .len = sizeof(struct tc_pedit) },
32}; 30};
@@ -218,7 +216,6 @@ nla_put_failure:
218 216
219static struct tc_action_ops act_pedit_ops = { 217static struct tc_action_ops act_pedit_ops = {
220 .kind = "pedit", 218 .kind = "pedit",
221 .hinfo = &pedit_hash_info,
222 .type = TCA_ACT_PEDIT, 219 .type = TCA_ACT_PEDIT,
223 .owner = THIS_MODULE, 220 .owner = THIS_MODULE,
224 .act = tcf_pedit, 221 .act = tcf_pedit,
@@ -233,15 +230,11 @@ MODULE_LICENSE("GPL");
233 230
234static int __init pedit_init_module(void) 231static int __init pedit_init_module(void)
235{ 232{
236 int err = tcf_hashinfo_init(&pedit_hash_info, PEDIT_TAB_MASK); 233 return tcf_register_action(&act_pedit_ops, PEDIT_TAB_MASK);
237 if (err)
238 return err;
239 return tcf_register_action(&act_pedit_ops);
240} 234}
241 235
242static void __exit pedit_cleanup_module(void) 236static void __exit pedit_cleanup_module(void)
243{ 237{
244 tcf_hashinfo_destroy(&pedit_hash_info);
245 tcf_unregister_action(&act_pedit_ops); 238 tcf_unregister_action(&act_pedit_ops);
246} 239}
247 240
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 7ff7bef065bf..0566e4606a4a 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -41,7 +41,6 @@ struct tcf_police {
41 container_of(pc, struct tcf_police, common) 41 container_of(pc, struct tcf_police, common)
42 42
43#define POL_TAB_MASK 15 43#define POL_TAB_MASK 15
44static struct tcf_hashinfo police_hash_info;
45 44
46/* old policer structure from before tc actions */ 45/* old policer structure from before tc actions */
47struct tc_police_compat { 46struct tc_police_compat {
@@ -234,7 +233,7 @@ override:
234 233
235 police->tcfp_t_c = ktime_to_ns(ktime_get()); 234 police->tcfp_t_c = ktime_to_ns(ktime_get());
236 police->tcf_index = parm->index ? parm->index : 235 police->tcf_index = parm->index ? parm->index :
237 tcf_hash_new_index(a->ops->hinfo); 236 tcf_hash_new_index(hinfo);
238 h = tcf_hash(police->tcf_index, POL_TAB_MASK); 237 h = tcf_hash(police->tcf_index, POL_TAB_MASK);
239 spin_lock_bh(&hinfo->lock); 238 spin_lock_bh(&hinfo->lock);
240 hlist_add_head(&police->tcf_head, &hinfo->htab[h]); 239 hlist_add_head(&police->tcf_head, &hinfo->htab[h]);
@@ -349,7 +348,6 @@ MODULE_LICENSE("GPL");
349 348
350static struct tc_action_ops act_police_ops = { 349static struct tc_action_ops act_police_ops = {
351 .kind = "police", 350 .kind = "police",
352 .hinfo = &police_hash_info,
353 .type = TCA_ID_POLICE, 351 .type = TCA_ID_POLICE,
354 .owner = THIS_MODULE, 352 .owner = THIS_MODULE,
355 .act = tcf_act_police, 353 .act = tcf_act_police,
@@ -361,19 +359,12 @@ static struct tc_action_ops act_police_ops = {
361static int __init 359static int __init
362police_init_module(void) 360police_init_module(void)
363{ 361{
364 int err = tcf_hashinfo_init(&police_hash_info, POL_TAB_MASK); 362 return tcf_register_action(&act_police_ops, POL_TAB_MASK);
365 if (err)
366 return err;
367 err = tcf_register_action(&act_police_ops);
368 if (err)
369 tcf_hashinfo_destroy(&police_hash_info);
370 return err;
371} 363}
372 364
373static void __exit 365static void __exit
374police_cleanup_module(void) 366police_cleanup_module(void)
375{ 367{
376 tcf_hashinfo_destroy(&police_hash_info);
377 tcf_unregister_action(&act_police_ops); 368 tcf_unregister_action(&act_police_ops);
378} 369}
379 370
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
index 14b5e362a1d6..992c2317ce88 100644
--- a/net/sched/act_simple.c
+++ b/net/sched/act_simple.c
@@ -25,7 +25,6 @@
25#include <net/tc_act/tc_defact.h> 25#include <net/tc_act/tc_defact.h>
26 26
27#define SIMP_TAB_MASK 7 27#define SIMP_TAB_MASK 7
28static struct tcf_hashinfo simp_hash_info;
29 28
30#define SIMP_MAX_DATA 32 29#define SIMP_MAX_DATA 32
31static int tcf_simp(struct sk_buff *skb, const struct tc_action *a, 30static int tcf_simp(struct sk_buff *skb, const struct tc_action *a,
@@ -163,7 +162,6 @@ nla_put_failure:
163 162
164static struct tc_action_ops act_simp_ops = { 163static struct tc_action_ops act_simp_ops = {
165 .kind = "simple", 164 .kind = "simple",
166 .hinfo = &simp_hash_info,
167 .type = TCA_ACT_SIMP, 165 .type = TCA_ACT_SIMP,
168 .owner = THIS_MODULE, 166 .owner = THIS_MODULE,
169 .act = tcf_simp, 167 .act = tcf_simp,
@@ -178,23 +176,15 @@ MODULE_LICENSE("GPL");
178 176
179static int __init simp_init_module(void) 177static int __init simp_init_module(void)
180{ 178{
181 int err, ret; 179 int ret;
182 err = tcf_hashinfo_init(&simp_hash_info, SIMP_TAB_MASK); 180 ret = tcf_register_action(&act_simp_ops, SIMP_TAB_MASK);
183 if (err)
184 return err;
185
186 ret = tcf_register_action(&act_simp_ops);
187 if (!ret) 181 if (!ret)
188 pr_info("Simple TC action Loaded\n"); 182 pr_info("Simple TC action Loaded\n");
189 else
190 tcf_hashinfo_destroy(&simp_hash_info);
191
192 return ret; 183 return ret;
193} 184}
194 185
195static void __exit simp_cleanup_module(void) 186static void __exit simp_cleanup_module(void)
196{ 187{
197 tcf_hashinfo_destroy(&simp_hash_info);
198 tcf_unregister_action(&act_simp_ops); 188 tcf_unregister_action(&act_simp_ops);
199} 189}
200 190
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c
index 9f91928fcaeb..fcfeeaf838be 100644
--- a/net/sched/act_skbedit.c
+++ b/net/sched/act_skbedit.c
@@ -28,7 +28,6 @@
28#include <net/tc_act/tc_skbedit.h> 28#include <net/tc_act/tc_skbedit.h>
29 29
30#define SKBEDIT_TAB_MASK 15 30#define SKBEDIT_TAB_MASK 15
31static struct tcf_hashinfo skbedit_hash_info;
32 31
33static int tcf_skbedit(struct sk_buff *skb, const struct tc_action *a, 32static int tcf_skbedit(struct sk_buff *skb, const struct tc_action *a,
34 struct tcf_result *res) 33 struct tcf_result *res)
@@ -175,7 +174,6 @@ nla_put_failure:
175 174
176static struct tc_action_ops act_skbedit_ops = { 175static struct tc_action_ops act_skbedit_ops = {
177 .kind = "skbedit", 176 .kind = "skbedit",
178 .hinfo = &skbedit_hash_info,
179 .type = TCA_ACT_SKBEDIT, 177 .type = TCA_ACT_SKBEDIT,
180 .owner = THIS_MODULE, 178 .owner = THIS_MODULE,
181 .act = tcf_skbedit, 179 .act = tcf_skbedit,
@@ -189,15 +187,11 @@ MODULE_LICENSE("GPL");
189 187
190static int __init skbedit_init_module(void) 188static int __init skbedit_init_module(void)
191{ 189{
192 int err = tcf_hashinfo_init(&skbedit_hash_info, SKBEDIT_TAB_MASK); 190 return tcf_register_action(&act_skbedit_ops, SKBEDIT_TAB_MASK);
193 if (err)
194 return err;
195 return tcf_register_action(&act_skbedit_ops);
196} 191}
197 192
198static void __exit skbedit_cleanup_module(void) 193static void __exit skbedit_cleanup_module(void)
199{ 194{
200 tcf_hashinfo_destroy(&skbedit_hash_info);
201 tcf_unregister_action(&act_skbedit_ops); 195 tcf_unregister_action(&act_skbedit_ops);
202} 196}
203 197