From 1a39d1e68c03b980b8a78c9d42714d9e95bd23d4 Mon Sep 17 00:00:00 2001 From: Jonas Berlin Date: Fri, 15 Apr 2005 09:35:24 +0000 Subject: fix iptables-save/restore of goto (Jonas Berlin) --- iptables-save.c | 2 +- iptables.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/iptables-save.c b/iptables-save.c index 6c7267e2..4f6f156d 100644 --- a/iptables-save.c +++ b/iptables-save.c @@ -197,7 +197,7 @@ static void print_rule(const struct ipt_entry *e, /* Print target name */ target_name = iptc_get_target(e, h); if (target_name && (*target_name != '\0')) - printf("-j %s ", target_name); + printf("-%c %s ", e->ip.flags & IPT_F_GOTO ? 'g' : 'j', target_name); /* Print targinfo part */ t = ipt_get_target((struct ipt_entry *)e); diff --git a/iptables.c b/iptables.c index 27c5cfac..cfea34fa 100644 --- a/iptables.c +++ b/iptables.c @@ -1393,6 +1393,9 @@ print_firewall(const struct ipt_entry *fw, if (format & FMT_NOTABLE) fputs(" ", stdout); + if(fw->ip.flags & IPT_F_GOTO) + printf("[goto] "); + IPT_MATCH_ITERATE(fw, print_match, &fw->ip, format & FMT_NUMERIC); if (target) { -- cgit v1.2.3