From c167e01221fc8541240b5c0505516e35a216d0eb Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Wed, 7 Aug 2013 11:31:37 +0300 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- iptables/nft-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'iptables/nft-shared.c') 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); -- cgit v1.2.3