summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2005-11-24 17:04:05 +0000
committerHarald Welte <laforge@gnumonks.org>2005-11-24 17:04:05 +0000
commit72bd87e13b76818f5c690a9097080123ff698bc2 (patch)
tree0bda2ab51ec3482c7010dccc2bc629f2fd6a3731
parent3a02693b57bf968921aa76109712367af17c1a68 (diff)
fix compilation of iptables on [old] systems that don't have IPT_F_GOTO
-rw-r--r--iptables-save.c4
-rw-r--r--iptables.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/iptables-save.c b/iptables-save.c
index 4f6f156d..79b5dc7f 100644
--- a/iptables-save.c
+++ b/iptables-save.c
@@ -197,7 +197,11 @@ 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'))
+#ifdef IPT_F_GOTO
printf("-%c %s ", e->ip.flags & IPT_F_GOTO ? 'g' : 'j', target_name);
+#else
+ printf("-j %s ", target_name);
+#endif
/* Print targinfo part */
t = ipt_get_target((struct ipt_entry *)e);
diff --git a/iptables.c b/iptables.c
index cc8d423c..1ea80635 100644
--- a/iptables.c
+++ b/iptables.c
@@ -1415,8 +1415,10 @@ print_firewall(const struct ipt_entry *fw,
if (format & FMT_NOTABLE)
fputs(" ", stdout);
+#ifdef IPT_F_GOTO
if(fw->ip.flags & IPT_F_GOTO)
printf("[goto] ");
+#endif
IPT_MATCH_ITERATE(fw, print_match, &fw->ip, format & FMT_NUMERIC);