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/scanner.l | 1 + 1 file changed, 1 insertion(+) (limited to 'src/scanner.l') diff --git a/src/scanner.l b/src/scanner.l index aa0a0a9f..c0c49b97 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -359,6 +359,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) "import" { scanner_push_start_cond(yyscanner, SCANSTATE_CMD_IMPORT); return IMPORT; } "export" { scanner_push_start_cond(yyscanner, SCANSTATE_CMD_EXPORT); return EXPORT; } "monitor" { scanner_push_start_cond(yyscanner, SCANSTATE_CMD_MONITOR); return MONITOR; } +"destroy" { return DESTROY; } "position" { return POSITION; } "index" { return INDEX; } -- cgit v1.2.3