From 1d2e22fc0521bcf73ee1f891c291dc1bde47a6bb Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Mon, 19 Jun 2023 22:43:06 +0200 Subject: ct timeout: fix 'list object x' vs. 'list objects in table' confusion $ nft list ct timeout table t Error: No such file or directory list ct timeout table t ^ This is expected to list all 'ct timeout' objects. The failure is correct, the table 't' does not exist. But now lets add one: $ nft add table t $ nft list ct timeout table t Segmentation fault (core dumped) ... and thats not expected, nothing should be shown and nft should exit normally. Because of missing TIMEOUTS command enum, the backend thinks it should do an object lookup, but as frontend asked for 'list of objects' rather than 'show this object', handle.obj.name is NULL, which then results in this crash. Update the command enums so that backend knows what the frontend asked for. Signed-off-by: Florian Westphal --- 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 becfa57f..d908ae0a 100644 --- a/src/cache.c +++ b/src/cache.c @@ -370,6 +370,7 @@ static int nft_handle_validate(const struct cmd *cmd, struct list_head *msgs) case CMD_OBJ_CT_HELPER: case CMD_OBJ_CT_HELPERS: case CMD_OBJ_CT_TIMEOUT: + case CMD_OBJ_CT_TIMEOUTS: case CMD_OBJ_CT_EXPECT: if (h->table.name && strlen(h->table.name) > NFT_NAME_MAXLEN) { -- cgit v1.2.3