Commit e9d90bfc authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso Committed by Greg Kroah-Hartman

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

commit 23b7ca4f 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: 's avatarPhil Sutter <>
Acked-by: 's avatarPhil Sutter <>
Signed-off-by: 's avatarPablo Neira Ayuso <>
Signed-off-by: 's avatarGreg Kroah-Hartman <>
parent 848a7f24
......@@ -307,6 +307,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))
err = nft_delrule(ctx, rule);
if (err < 0)
return err;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment