summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2001-07-05 06:29:10 +0000
committerHarald Welte <laforge@gnumonks.org>2001-07-05 06:29:10 +0000
commitace8a01d5a0ae1a0b99fc2dabdab64a5275c3259 (patch)
treef381f5285d692a24dbe7e086bbd42d1f8b9f258a
parent87d4be4a567e1d7a6c8827513f431df036334cc8 (diff)
ip6tables-save without target fix, scoreboard
-rw-r--r--ip6tables-save.c5
-rw-r--r--iptables-save.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/ip6tables-save.c b/ip6tables-save.c
index 4af811a0..d8b15c31 100644
--- a/ip6tables-save.c
+++ b/ip6tables-save.c
@@ -155,6 +155,7 @@ static void print_rule(const struct ip6t_entry *e,
ip6tc_handle_t *h, int counters)
{
struct ip6t_entry_target *t;
+ const char *target_name;
/* print counters */
if (counters)
@@ -196,7 +197,9 @@ static void print_rule(const struct ip6t_entry *e,
}
/* Print target name */
- printf("-j %s ", ip6tc_get_target(e, h));
+ target_name = ip6tc_get_target(e, h);
+ if (target_name && *target_name != '\0')
+ printf("-j %s ", ip6tc_get_target(e, h));
/* Print targinfo part */
t = ip6t_get_target((struct ip6t_entry *)e);
diff --git a/iptables-save.c b/iptables-save.c
index 11ee3e37..6bee3372 100644
--- a/iptables-save.c
+++ b/iptables-save.c
@@ -148,7 +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;
+ const char *target_name;
/* print counters */
if (counters)