summaryrefslogtreecommitdiffstats
path: root/src/cache.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2023-06-19 22:43:06 +0200
committerFlorian Westphal <fw@strlen.de>2023-06-20 21:47:53 +0200
commit1d2e22fc0521bcf73ee1f891c291dc1bde47a6bb (patch)
tree6274cc3330a6199fe3624595eb94698b194e7802 /src/cache.c
parentd40c7623837424d4eb8048508b924887b092e050 (diff)
ct timeout: fix 'list object x' vs. 'list objects in table' confusion
<empty ruleset> $ 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 <fw@strlen.de>
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c1
1 files changed, 1 insertions, 0 deletions
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) {