diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-02-15 12:50:24 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-02-15 15:32:32 +0100 |
commit | 23b7ca4f745f21c2b9cfcb67fdd33733b3ae7e66 (patch) | |
tree | 2a46afb0992d641ec31b74b905ce31da81bf2dd4 /net/netfilter | |
parent | f9bcc9f3ee4fbbe8f11dfec76745476f5780517e (diff) | |
download | linux-stable-23b7ca4f745f21c2b9cfcb67fdd33733b3ae7e66.tar.gz linux-stable-23b7ca4f745f21c2b9cfcb67fdd33733b3ae7e66.tar.bz2 linux-stable-23b7ca4f745f21c2b9cfcb67fdd33733b3ae7e66.zip |
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: cf9dc09d0949 ("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>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nf_tables_api.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 5a92f23f179f..4893f248dfdc 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -313,6 +313,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; |