aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorJamal Hadi Salim <jhs@mojatatu.com>2013-04-28 01:06:38 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-01 13:19:19 -0400
commit0dcffd09641f3abb21ac5cabc61542ab289d1a3c (patch)
treec13f5c0be250df5435c67a73ebd7e8cc62dcce9b /net/sched
parentfe86d714168f1567989c309f73a3550022686301 (diff)
net_sched: act_ipt forward compat with xtables
Deal with changes in newer xtables while maintaining backward compatibility. Thanks to Jan Engelhardt for suggestions. 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_ipt.c33
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
306MODULE_AUTHOR("Jamal Hadi Salim(2002-4)"); 306static 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
320MODULE_AUTHOR("Jamal Hadi Salim(2002-13)");
307MODULE_DESCRIPTION("Iptables target actions"); 321MODULE_DESCRIPTION("Iptables target actions");
308MODULE_LICENSE("GPL"); 322MODULE_LICENSE("GPL");
323MODULE_ALIAS("act_xt");
309 324
310static int __init ipt_init_module(void) 325static 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
315static void __exit ipt_cleanup_module(void) 341static 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