Skip to content

Commit 3f8af15

Browse files
committed
netfilter: nf_tables: bogus ENOENT when destroying element which does not exist
JIRA: https://issues.redhat.com/browse/RHEL-21443 Upstream Status: commit a7d5a95 commit a7d5a95 Author: Pablo Neira Ayuso <pablo@netfilter.org> Date: Mon Nov 13 20:34:56 2023 +0100 netfilter: nf_tables: bogus ENOENT when destroying element which does not exist destroy element command bogusly reports ENOENT in case a set element does not exist. ENOENT errors are skipped, however, err is still set and propagated to userspace. # nft destroy element ip raw BLACKLIST { 1.2.3.4 } Error: Could not process rule: No such file or directory destroy element ip raw BLACKLIST { 1.2.3.4 } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Fixes: f80a612 ("netfilter: nf_tables: add support to destroy operation") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fwestpha@redhat.com>
1 parent e7fce92 commit 3f8af15

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7012,10 +7012,11 @@ static int nf_tables_delsetelem(struct sk_buff *skb,
70127012

70137013
if (err < 0) {
70147014
NL_SET_BAD_ATTR(extack, attr);
7015-
break;
7015+
return err;
70167016
}
70177017
}
7018-
return err;
7018+
7019+
return 0;
70197020
}
70207021

70217022
/*

0 commit comments

Comments
 (0)