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/parser_bison.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index e7ee56c1..beb277b6 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -4757,7 +4757,7 @@ ct_obj_type : HELPER { $$ = NFT_OBJECT_CT_HELPER; } ; ct_cmd_type : HELPERS { $$ = CMD_OBJ_CT_HELPERS; } - | TIMEOUT { $$ = CMD_OBJ_CT_TIMEOUT; } + | TIMEOUT { $$ = CMD_OBJ_CT_TIMEOUTS; } | EXPECTATION { $$ = CMD_OBJ_CT_EXPECT; } ; -- cgit v1.2.3