netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iptables PATCH v2 1/2] arptables-compat: add support for the CLASSIFY target
@ 2015-03-05 18:47 Arturo Borrero Gonzalez
  2015-03-05 18:47 ` [iptables PATCH v2 2/2] arptables-compat: delete extra space in target printing Arturo Borrero Gonzalez
  2015-03-05 20:57 ` [iptables PATCH v2 1/2] arptables-compat: add support for the CLASSIFY target Pablo Neira Ayuso
  0 siblings, 2 replies; 4+ messages in thread
From: Arturo Borrero Gonzalez @ 2015-03-05 18:47 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo

This patch adds support to arptables-compat for the CLASSIFY target.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
v2: split in two patches

 extensions/libxt_CLASSIFY.c |   44 +++++++++++++++++++++++++++++++------------
 1 file changed, 32 insertions(+), 12 deletions(-)

diff --git a/extensions/libxt_CLASSIFY.c b/extensions/libxt_CLASSIFY.c
index e04657a..cd016d8 100644
--- a/extensions/libxt_CLASSIFY.c
+++ b/extensions/libxt_CLASSIFY.c
@@ -73,20 +73,40 @@ CLASSIFY_save(const void *ip, const struct xt_entry_target *target)
 	       TC_H_MAJ(clinfo->priority)>>16, TC_H_MIN(clinfo->priority));
 }
 
-static struct xtables_target classify_target = { 
-	.family		= NFPROTO_UNSPEC,
-	.name		= "CLASSIFY",
-	.version	= XTABLES_VERSION,
-	.size		= XT_ALIGN(sizeof(struct xt_classify_target_info)),
-	.userspacesize	= XT_ALIGN(sizeof(struct xt_classify_target_info)),
-	.help		= CLASSIFY_help,
-	.print		= CLASSIFY_print,
-	.save		= CLASSIFY_save,
-	.x6_parse	= CLASSIFY_parse,
-	.x6_options	= CLASSIFY_opts,
+static void
+arpCLASSIFY_print(const void *ip, const struct xt_entry_target *target,
+		  int numeric)
+{
+	CLASSIFY_save(ip, target);
+}
+
+static struct xtables_target classify_target[] = {
+	{
+		.family		= NFPROTO_UNSPEC,
+		.name		= "CLASSIFY",
+		.version	= XTABLES_VERSION,
+		.size		= XT_ALIGN(sizeof(struct xt_classify_target_info)),
+		.userspacesize	= XT_ALIGN(sizeof(struct xt_classify_target_info)),
+		.help		= CLASSIFY_help,
+		.print		= CLASSIFY_print,
+		.save		= CLASSIFY_save,
+		.x6_parse	= CLASSIFY_parse,
+		.x6_options	= CLASSIFY_opts,
+	},
+	{
+		.family		= NFPROTO_ARP,
+		.name		= "CLASSIFY",
+		.version	= XTABLES_VERSION,
+		.size		= XT_ALIGN(sizeof(struct xt_classify_target_info)),
+		.userspacesize	= XT_ALIGN(sizeof(struct xt_classify_target_info)),
+		.help		= CLASSIFY_help,
+		.print		= arpCLASSIFY_print,
+		.x6_parse	= CLASSIFY_parse,
+		.x6_options	= CLASSIFY_opts,
+	},
 };
 
 void _init(void)
 {
-	xtables_register_target(&classify_target);
+	xtables_register_targets(classify_target, ARRAY_SIZE(classify_target));
 }


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [iptables PATCH v2 2/2] arptables-compat: delete extra space in target printing
  2015-03-05 18:47 [iptables PATCH v2 1/2] arptables-compat: add support for the CLASSIFY target Arturo Borrero Gonzalez
@ 2015-03-05 18:47 ` Arturo Borrero Gonzalez
  2015-03-05 20:57   ` Pablo Neira Ayuso
  2015-03-05 20:57 ` [iptables PATCH v2 1/2] arptables-compat: add support for the CLASSIFY target Pablo Neira Ayuso
  1 sibling, 1 reply; 4+ messages in thread
From: Arturo Borrero Gonzalez @ 2015-03-05 18:47 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo

This is an extra space, let's get rid of it.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
v2: split in two patches

 iptables/nft-arp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iptables/nft-arp.c b/iptables/nft-arp.c
index 523b3ec..503c65a 100644
--- a/iptables/nft-arp.c
+++ b/iptables/nft-arp.c
@@ -593,7 +593,7 @@ nft_arp_print_firewall(struct nft_rule *r, unsigned int num,
 	if (cs.jumpto != NULL && strcmp(cs.jumpto, "") != 0) {
 		printf("-j %s", cs.jumpto);
 	} else if (cs.target) {
-		printf("-j %s ", cs.target->name);
+		printf("-j %s", cs.target->name);
 		cs.target->print(&cs.fw, cs.target->t, format & FMT_NUMERIC);
 	}
 


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [iptables PATCH v2 1/2] arptables-compat: add support for the CLASSIFY target
  2015-03-05 18:47 [iptables PATCH v2 1/2] arptables-compat: add support for the CLASSIFY target Arturo Borrero Gonzalez
  2015-03-05 18:47 ` [iptables PATCH v2 2/2] arptables-compat: delete extra space in target printing Arturo Borrero Gonzalez
@ 2015-03-05 20:57 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2015-03-05 20:57 UTC (permalink / raw)
  To: Arturo Borrero Gonzalez; +Cc: netfilter-devel

On Thu, Mar 05, 2015 at 07:47:38PM +0100, Arturo Borrero Gonzalez wrote:
> This patch adds support to arptables-compat for the CLASSIFY target.

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [iptables PATCH v2 2/2] arptables-compat: delete extra space in target printing
  2015-03-05 18:47 ` [iptables PATCH v2 2/2] arptables-compat: delete extra space in target printing Arturo Borrero Gonzalez
@ 2015-03-05 20:57   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2015-03-05 20:57 UTC (permalink / raw)
  To: Arturo Borrero Gonzalez; +Cc: netfilter-devel

On Thu, Mar 05, 2015 at 07:47:52PM +0100, Arturo Borrero Gonzalez wrote:
> This is an extra space, let's get rid of it.

Also applied, thanks Arturo.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-05 20:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-05 18:47 [iptables PATCH v2 1/2] arptables-compat: add support for the CLASSIFY target Arturo Borrero Gonzalez
2015-03-05 18:47 ` [iptables PATCH v2 2/2] arptables-compat: delete extra space in target printing Arturo Borrero Gonzalez
2015-03-05 20:57   ` Pablo Neira Ayuso
2015-03-05 20:57 ` [iptables PATCH v2 1/2] arptables-compat: add support for the CLASSIFY target Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).