提交 1500d94e 编写于 作者: P Pablo Neira Ayuso 提交者: Greg Kroah-Hartman

netfilter: nf_tables: fix flush after rule deletion in the same batch

commit 23b7ca4f745f21c2b9cfcb67fdd33733b3ae7e66 upstream.

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: cf9dc09d ("netfilter: nf_tables: fix missing rules flushing per table")
Reported-by: NPhil Sutter <phil@nwl.cc>
Acked-by: NPhil Sutter <phil@nwl.cc>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6ecc7407
...@@ -291,6 +291,9 @@ static int nft_delrule_by_chain(struct nft_ctx *ctx) ...@@ -291,6 +291,9 @@ static int nft_delrule_by_chain(struct nft_ctx *ctx)
int err; int err;
list_for_each_entry(rule, &ctx->chain->rules, list) { list_for_each_entry(rule, &ctx->chain->rules, list) {
if (!nft_is_active_next(ctx->net, rule))
continue;
err = nft_delrule(ctx, rule); err = nft_delrule(ctx, rule);
if (err < 0) if (err < 0)
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册