From d3d66fb992dac9a790aed5ecd03af8ceb1ec4a1b Mon Sep 17 00:00:00 2001 From: laforge 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(-) (limited to 'iptables-save.c') diff --git a/iptables-save.c b/iptables-save.c index 282ca7f..11ee3e3 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