summaryrefslogtreecommitdiffstats
path: root/iptables/nft-arp.c
diff options
context:
space:
mode:
authorArturo Borrero <arturo.borrero.glez@gmail.com>2015-02-13 11:38:02 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2015-02-18 23:43:07 +0100
commit34c36aeebd0b44629ef6c54a3087b3b531ccc1a5 (patch)
tree02bddf39a0090c482841ed544d5b6e1d6a9396e7 /iptables/nft-arp.c
parent6dc53c514f1e4683e51a877b3a2f3128cfccef28 (diff)
arptables-compat: add mangle target extension
This patch adds support to use the mangle target extensions, along with the required changes in the surrounding code. Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/nft-arp.c')
-rw-r--r--iptables/nft-arp.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/iptables/nft-arp.c b/iptables/nft-arp.c
index 24b31c5a..05672014 100644
--- a/iptables/nft-arp.c
+++ b/iptables/nft-arp.c
@@ -402,10 +402,11 @@ void nft_rule_to_arptables_command_state(struct nft_rule *r,
nft_rule_expr_iter_destroy(iter);
- if (cs->target != NULL)
- cs->jumpto = cs->target->name;
- else if (cs->jumpto != NULL)
- cs->target = xtables_find_target(cs->jumpto, XTF_TRY_LOAD);
+ if (cs->jumpto != NULL)
+ return;
+
+ if (cs->target != NULL && cs->target->name != NULL)
+ cs->target = xtables_find_target(cs->target->name, XTF_TRY_LOAD);
else
cs->jumpto = "";
}
@@ -585,13 +586,11 @@ nft_arp_print_firewall(struct nft_rule *r, unsigned int num,
print_fw_details(&cs.fw, format);
- if (strlen(cs.jumpto) > 0) {
- printf("-j %s\n", cs.jumpto);
+ if (cs.jumpto != NULL && strcmp(cs.jumpto, "") != 0) {
+ printf("-j %s", cs.jumpto);
} else if (cs.target) {
- if (cs.target->print)
- /* Print the target information. */
- cs.target->print(&cs.fw, cs.target->t,
- format & FMT_NUMERIC);
+ printf("-j %s ", cs.target->name);
+ cs.target->print(&cs.fw, cs.target->t, format & FMT_NUMERIC);
}
if (!(format & FMT_NOCOUNTS)) {