diff options
| -rw-r--r-- | net/sched/act_ipt.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c index e0f6de64afec..60d88b6b9560 100644 --- a/net/sched/act_ipt.c +++ b/net/sched/act_ipt.c | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | * as published by the Free Software Foundation; either version | 8 | * as published by the Free Software Foundation; either version |
| 9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
| 10 | * | 10 | * |
| 11 | * Copyright: Jamal Hadi Salim (2002-4) | 11 | * Copyright: Jamal Hadi Salim (2002-13) |
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| @@ -303,17 +303,44 @@ static struct tc_action_ops act_ipt_ops = { | |||
| 303 | .walk = tcf_generic_walker | 303 | .walk = tcf_generic_walker |
| 304 | }; | 304 | }; |
| 305 | 305 | ||
| 306 | MODULE_AUTHOR("Jamal Hadi Salim(2002-4)"); | 306 | static struct tc_action_ops act_xt_ops = { |
| 307 | .kind = "xt", | ||
| 308 | .hinfo = &ipt_hash_info, | ||
| 309 | .type = TCA_ACT_IPT, | ||
| 310 | .capab = TCA_CAP_NONE, | ||
| 311 | .owner = THIS_MODULE, | ||
| 312 | .act = tcf_ipt, | ||
| 313 | .dump = tcf_ipt_dump, | ||
| 314 | .cleanup = tcf_ipt_cleanup, | ||
| 315 | .lookup = tcf_hash_search, | ||
| 316 | .init = tcf_ipt_init, | ||
| 317 | .walk = tcf_generic_walker | ||
| 318 | }; | ||
| 319 | |||
| 320 | MODULE_AUTHOR("Jamal Hadi Salim(2002-13)"); | ||
| 307 | MODULE_DESCRIPTION("Iptables target actions"); | 321 | MODULE_DESCRIPTION("Iptables target actions"); |
| 308 | MODULE_LICENSE("GPL"); | 322 | MODULE_LICENSE("GPL"); |
| 323 | MODULE_ALIAS("act_xt"); | ||
| 309 | 324 | ||
| 310 | static int __init ipt_init_module(void) | 325 | static int __init ipt_init_module(void) |
| 311 | { | 326 | { |
| 312 | return tcf_register_action(&act_ipt_ops); | 327 | int ret1, ret2; |
| 328 | ret1 = tcf_register_action(&act_xt_ops); | ||
| 329 | if (ret1 < 0) | ||
| 330 | printk("Failed to load xt action\n"); | ||
| 331 | ret2 = tcf_register_action(&act_ipt_ops); | ||
| 332 | if (ret2 < 0) | ||
| 333 | printk("Failed to load ipt action\n"); | ||
| 334 | |||
| 335 | if (ret1 < 0 && ret2 < 0) | ||
| 336 | return ret1; | ||
| 337 | else | ||
| 338 | return 0; | ||
| 313 | } | 339 | } |
| 314 | 340 | ||
| 315 | static void __exit ipt_cleanup_module(void) | 341 | static void __exit ipt_cleanup_module(void) |
| 316 | { | 342 | { |
| 343 | tcf_unregister_action(&act_xt_ops); | ||
| 317 | tcf_unregister_action(&act_ipt_ops); | 344 | tcf_unregister_action(&act_ipt_ops); |
| 318 | } | 345 | } |
| 319 | 346 | ||
