]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
A. van Schie: bug report "iptables-save doesn't save fall-through rules correctly"
authorHarald Welte <laforge@gnumonks.org>
Thu, 24 May 2001 23:22:28 +0000 (23:22 +0000)
committerHarald Welte <laforge@gnumonks.org>
Thu, 24 May 2001 23:22:28 +0000 (23:22 +0000)
iptables-save.c

index 282ca7f8890b721270f7ea80e07b5545db3a15b1..11ee3e373c3d5003c3d7e5c301b4ca295c897fe0 100644 (file)
@@ -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);