mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
netfilter: nf_tables: fix flush after rule deletion in the same batch
commit23b7ca4f74upstream. Flush after rule deletion bogusly hits -ENOENT. Skip rules that have been already from nft_delrule_by_chain() which is always called from the flush path. Fixes:cf9dc09d09("netfilter: nf_tables: fix missing rules flushing per table") Reported-by: Phil Sutter <phil@nwl.cc> Acked-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -263,6 +263,9 @@ static int nft_delrule_by_chain(struct nft_ctx *ctx)
|
||||
int err;
|
||||
|
||||
list_for_each_entry(rule, &ctx->chain->rules, list) {
|
||||
if (!nft_is_active_next(ctx->net, rule))
|
||||
continue;
|
||||
|
||||
err = nft_delrule(ctx, rule);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
Reference in New Issue
Block a user