From 6f83cf034de43e3360675cff492c8ce01c47818a Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 24 May 2001 23:22:28 +0000 Subject: A. van Schie: bug report "iptables-save doesn't save fall-through rules correctly" --- iptables-save.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iptables-save.c b/iptables-save.c index 282ca7f8..11ee3e37 100644 --- a/iptables-save.c +++ b/iptables-save.c @@ -148,6 +148,7 @@ static void print_rule(const struct ipt_entry *e, iptc_handle_t *h, const char *chain, int counters) { struct ipt_entry_target *t; + char *target_name; /* print counters */ if (counters) @@ -181,7 +182,9 @@ static void print_rule(const struct ipt_entry *e, } /* Print target name */ - printf("-j %s ", iptc_get_target(e, h)); + target_name = iptc_get_target(e, h); + if (target_name && (*target_name != '\0')) + printf("-j %s ", target_name); /* Print targinfo part */ t = ipt_get_target((struct ipt_entry *)e); -- cgit v1.2.3