public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jamal Hadi Salim <jhs@mojatatu•com>
To: David Miller <davem@davemloft•net>
Cc: "netdev@vger•kernel.org" <netdev@vger•kernel.org>,
	Hasan Chowdhury <shemonc@gmail•com>,
	Jan Engelhardt <jengelh@inai•de>
Subject: [PATCH] net_sched:  act_ipt forward compat with xtables
Date: Sun, 28 Apr 2013 11:06:38 -0400	[thread overview]
Message-ID: <517D3AFE.8020001@mojatatu.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 445 bytes --]


I have done minimal testing on this on my environment. I took Jan's
advise to simplify things.

Hasan,
I know you have your head buried in the sand right now; but please
when you get the time test this patch with the latest iproute2 git
tree and send your tested-by credential.

Dave,
When Hasan nods I think this should also go into stable because none
of the newer kernels work with newer iptables (which is a lot of
distros).

cheers,
jamal

[-- Attachment #2: patch-xt-alter2 --]
[-- Type: text/plain, Size: 1849 bytes --]

commit 94c39d99038dd7fdea4922ae4cfb4ad683c1307c
Author: Jamal Hadi Salim <jhs@mojatatu•com>
Date:   Sun Apr 28 10:46:56 2013 -0400

    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>

diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index e0f6de6..60d88b6 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -8,7 +8,7 @@
  *		as published by the Free Software Foundation; either version
  *		2 of the License, or (at your option) any later version.
  *
- * Copyright:	Jamal Hadi Salim (2002-4)
+ * Copyright:	Jamal Hadi Salim (2002-13)
  */
 
 #include <linux/types.h>
@@ -303,17 +303,44 @@ static struct tc_action_ops act_ipt_ops = {
 	.walk		=	tcf_generic_walker
 };
 
-MODULE_AUTHOR("Jamal Hadi Salim(2002-4)");
+static struct tc_action_ops act_xt_ops = {
+	.kind		=	"xt",
+	.hinfo		=	&ipt_hash_info,
+	.type		=	TCA_ACT_IPT,
+	.capab		=	TCA_CAP_NONE,
+	.owner		=	THIS_MODULE,
+	.act		=	tcf_ipt,
+	.dump		=	tcf_ipt_dump,
+	.cleanup	=	tcf_ipt_cleanup,
+	.lookup		=	tcf_hash_search,
+	.init		=	tcf_ipt_init,
+	.walk		=	tcf_generic_walker
+};
+
+MODULE_AUTHOR("Jamal Hadi Salim(2002-13)");
 MODULE_DESCRIPTION("Iptables target actions");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("act_xt");
 
 static int __init ipt_init_module(void)
 {
-	return tcf_register_action(&act_ipt_ops);
+	int ret1, ret2;
+	ret1 = tcf_register_action(&act_xt_ops);
+	if (ret1 < 0)
+		printk("Failed to load xt action\n");
+	ret2 = tcf_register_action(&act_ipt_ops);
+	if (ret2 < 0)
+		printk("Failed to load ipt action\n");
+
+	if (ret1 < 0 && ret2 < 0)
+		return ret1;
+	else
+		return 0;
 }
 
 static void __exit ipt_cleanup_module(void)
 {
+	tcf_unregister_action(&act_xt_ops);
 	tcf_unregister_action(&act_ipt_ops);
 }
 

             reply	other threads:[~2013-04-28 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-28 15:06 Jamal Hadi Salim [this message]
2013-05-01 17:20 ` [PATCH] net_sched: act_ipt forward compat with xtables David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=517D3AFE.8020001@mojatatu.com \
    --to=jhs@mojatatu$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=jengelh@inai$(echo .)de \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=shemonc@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox