]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: add support to command "destroy"
authorFernando F. Mancera <ffmancera@riseup.net>
Mon, 6 Feb 2023 10:06:42 +0000 (11:06 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 6 Feb 2023 10:09:38 +0000 (11:09 +0100)
commite1dfd5cc4c46514a84dd8a2063b45517b596e1ca
tree5a3501a87795ae93e433f2fb2a133bb3ffe97375
parentb691e2ea1d643adeb89c576a105f08cfff677cfb
src: add support to command "destroy"

"destroy" command performs a deletion as "delete" command but does not fail
if the object does not exist. As there is no NLM_F_* flag for ignoring such
error, it needs to be ignored directly on error handling.

Example of use:

# nft list ruleset
        table ip filter {
                chain output {
                }
        }
        # nft destroy table ip missingtable
# echo $?
0
        # nft list ruleset
        table ip filter {
                chain output {
                }
        }

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
14 files changed:
doc/nft.txt
include/linux/netfilter/nf_tables.h
include/rule.h
src/cache.c
src/evaluate.c
src/mnl.c
src/parser_bison.y
src/parser_json.c
src/rule.c
src/scanner.l
tests/shell/testcases/rule_management/0011destroy_0 [new file with mode: 0755]
tests/shell/testcases/rule_management/0012destroy_0 [new file with mode: 0755]
tests/shell/testcases/rule_management/dumps/0011destroy_0.nft [new file with mode: 0644]
tests/shell/testcases/rule_management/dumps/0012destroy_0.nft [new file with mode: 0644]