summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2012-10-08 00:55:43 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2012-10-08 00:58:04 +0200
commit2aaa7ec29059027756f076c4767b4fa034ebd166 (patch)
treef1613f46ced938469805ab3795f2db72c2acdda2
parent3fdf783ec78e7a7bffb2cd48d5bc6b3264b00dd2 (diff)
iptables: fix standard target
This regression was added by: commit cd2f9bdbb7f9b737e5d640aafeb78bcd8e3a7adf Author: Jan Engelhardt <jengelh@inai.de> Date: Tue Sep 4 05:24:47 2012 +0200 iptables: support for target aliase The result is that: iptables -I INPUT -j ACCEPT says: iptables: No chain/target/match by that name. This also breaks iptables-restore, of course. Jan, you'll have to explain me how you have tested this. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--iptables/ip6tables.c5
-rw-r--r--iptables/iptables.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c
index 36612161..faddb71b 100644
--- a/iptables/ip6tables.c
+++ b/iptables/ip6tables.c
@@ -1286,7 +1286,10 @@ static void command_jump(struct iptables_command_state *cs)
cs->target->t = xtables_calloc(1, size);
cs->target->t->u.target_size = size;
- strcpy(cs->target->t->u.user.name, cs->target->real_name);
+ if (cs->target->real_name != NULL)
+ strcpy(cs->target->t->u.user.name, cs->jumpto);
+ else
+ strcpy(cs->target->t->u.user.name, cs->target->real_name);
cs->target->t->u.user.revision = cs->target->revision;
if (cs->target->real_name != cs->target->name)
fprintf(stderr, "WARNING: The %s target is obsolete. "
diff --git a/iptables/iptables.c b/iptables/iptables.c
index e935f651..96cea64d 100644
--- a/iptables/iptables.c
+++ b/iptables/iptables.c
@@ -1295,7 +1295,10 @@ static void command_jump(struct iptables_command_state *cs)
cs->target->t = xtables_calloc(1, size);
cs->target->t->u.target_size = size;
- strcpy(cs->target->t->u.user.name, cs->target->real_name);
+ if (cs->target->real_name != NULL)
+ strcpy(cs->target->t->u.user.name, cs->jumpto);
+ else
+ strcpy(cs->target->t->u.user.name, cs->target->real_name);
cs->target->t->u.user.revision = cs->target->revision;
if (cs->target->real_name != cs->target->name)
/* Alias support for userspace side */