]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
xtables-compat: fix bogus error with -X and no user-defined chains
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 7 May 2018 15:11:21 +0000 (17:11 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 7 May 2018 15:40:34 +0000 (17:40 +0200)
 # 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 <pablo@netfilter.org>
iptables/nft.c

index 7f9eb7f0e21af2ade9707bb5b8af756054021e9e..37c017f9a47c3aa951f64219bcd07f5a28d27764 100644 (file)
@@ -1539,7 +1539,7 @@ next:
 err:
 
        /* chain not found */
-       if (deleted_ctr == 0) {
+       if (chain != NULL && deleted_ctr == 0) {
                ret = -1;
                errno = ENOENT;
        }