From 4caa559c44cde7af7794937bd5c7e5f704a483ca Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 28 May 2018 20:21:10 +0200 Subject: xtables: initialize basechains for rule flush command too Otherwise, flush commands on not-yet-initialized basechains hit ENOENT. Signed-off-by: Pablo Neira Ayuso --- iptables/nft.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'iptables') diff --git a/iptables/nft.c b/iptables/nft.c index 66bd4d42..603ba306 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -1465,6 +1465,9 @@ int nft_rule_flush(struct nft_handle *h, const char *chain, const char *table) struct nftnl_chain_list_iter *iter; struct nftnl_chain *c; + if (nft_xtables_config_load(h, XTABLES_CONFIG_DEFAULT, 0) < 0) + nft_xt_builtin_init(h, table); + nft_fn = nft_rule_flush; list = nftnl_chain_list_get(h); -- cgit v1.2.3