diff options
author | Harald Welte <laforge@gnumonks.org> | 2001-05-24 23:22:28 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2001-05-24 23:22:28 +0000 |
commit | 6f83cf034de43e3360675cff492c8ce01c47818a (patch) | |
tree | de470b02c8ec9c1658744028a0bf2c7fc61a45ac /iptables-save.c | |
parent | de1578fc55c286a2f788a648cd5d702fd0b4aa40 (diff) |
A. van Schie: bug report "iptables-save doesn't save fall-through rules correctly"
Diffstat (limited to 'iptables-save.c')
-rw-r--r-- | iptables-save.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); |