Skip to content

Commit 23b7ca4

Browse files
committed
netfilter: nf_tables: fix flush after rule deletion in the same batch
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: cf9dc09 ("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>
1 parent f9bcc9f commit 23b7ca4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ static int nft_delrule_by_chain(struct nft_ctx *ctx)
313313
int err;
314314

315315
list_for_each_entry(rule, &ctx->chain->rules, list) {
316+
if (!nft_is_active_next(ctx->net, rule))
317+
continue;
318+
316319
err = nft_delrule(ctx, rule);
317320
if (err < 0)
318321
return err;

0 commit comments

Comments
 (0)