Skip to content

Commit a7d5a95

Browse files
committed
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 <[email protected]>
1 parent c301f09 commit a7d5a95

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
@@ -7263,10 +7263,11 @@ static int nf_tables_delsetelem(struct sk_buff *skb,
72637263

72647264
if (err < 0) {
72657265
NL_SET_BAD_ATTR(extack, attr);
7266-
break;
7266+
return err;
72677267
}
72687268
}
7269-
return err;
7269+
7270+
return 0;
72707271
}
72717272

72727273
/*

0 commit comments

Comments
 (0)