summaryrefslogtreecommitdiffstats
path: root/iptables/nft-shared.c
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2013-08-07 11:31:37 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2013-12-30 23:50:43 +0100
commitc167e01221fc8541240b5c0505516e35a216d0eb (patch)
treeae358e5d3882b8e46357ad5f408ba27871d409af /iptables/nft-shared.c
parente23e66f9d1a25c75df684850b7cd99053708c4d0 (diff)
nft: Print unknown target data only when relevant
Bug is: xtables -N test xtables -A FORWARD -j test xtables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination test all -- anywhere anywhere [0 bytes of unknown target data] Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain test (1 references) target prot opt source destination "[0 bytes of unknown target data]" should not be printed in this case. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/nft-shared.c')
-rw-r--r--iptables/nft-shared.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c
index 4a0317bc..dd4766b0 100644
--- a/iptables/nft-shared.c
+++ b/iptables/nft-shared.c
@@ -549,7 +549,7 @@ int print_target(const char *targname, const void *targinfo,
if (target->print)
/* FIXME missing first parameter */
target->print(NULL, t, format & FMT_NUMERIC);
- } else
+ } else if (target_len > 0)
printf("[%ld bytes of unknown target data] ", target_len);
free(t);