From e1dfd5cc4c46514a84dd8a2063b45517b596e1ca Mon Sep 17 00:00:00 2001 From: "Fernando F. Mancera" Date: Mon, 6 Feb 2023 11:06:42 +0100 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- src/cache.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/cache.c') diff --git a/src/cache.c b/src/cache.c index 0f5d1099..38bc219a 100644 --- a/src/cache.c +++ b/src/cache.c @@ -416,6 +416,7 @@ int nft_cache_evaluate(struct nft_ctx *nft, struct list_head *cmds, flags = NFT_CACHE_FULL; break; case CMD_DELETE: + case CMD_DESTROY: flags |= NFT_CACHE_TABLE | NFT_CACHE_CHAIN | NFT_CACHE_SET | -- cgit v1.2.3