Skip to content

Commit

Permalink
netfilter: nf_tables: fix flush after rule deletion in the same batch
Browse files Browse the repository at this point in the history
commit 23b7ca4 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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Pablo Neira Ayuso authored and Greg Kroah-Hartman committed Feb 27, 2019
1 parent 0b6633d commit deba234
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit deba234

Please sign in to comment.