Message ID | 20180528192739.10414-4-pablo@netfilter.org |
---|---|
State | Changes Requested |
Delegated to: | Pablo Neira |
Headers | show |
Series | [xtables,1/4] xtables: always initialize basechains on ruleset restore | expand |
diff --git a/iptables/nft.c b/iptables/nft.c index 3cfd23c7cdab..851073fb4a44 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -1397,6 +1397,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);
Otherwise, flush commands on not-yet-initialized basechains hit ENOENT. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> --- iptables/nft.c | 3 +++ 1 file changed, 3 insertions(+)