From 07ae37c0a627da445891fbffa71d27c3eee4fd0b Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 7 May 2018 17:11:21 +0200 Subject: xtables-compat: fix bogus error with -X and no user-defined chains # iptables-compat -X iptables: No chain/target/match by that name. While it should display no error message at all. Signed-off-by: Pablo Neira Ayuso --- iptables/nft.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'iptables') diff --git a/iptables/nft.c b/iptables/nft.c index 7f9eb7f0..37c017f9 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -1539,7 +1539,7 @@ next: err: /* chain not found */ - if (deleted_ctr == 0) { + if (chain != NULL && deleted_ctr == 0) { ret = -1; errno = ENOENT; } -- cgit v1.2.3