]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stick-tables: abort startup on stk_ctr pool creation failure
authorWilly Tarreau <w@1wt.eu>
Mon, 26 Jan 2026 10:31:24 +0000 (11:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 26 Jan 2026 10:45:49 +0000 (11:45 +0100)
Since 3.3 with commit 945aa0ea82 ("MINOR: initcalls: Add a new initcall
stage, STG_INIT_2"), stkt_late_init() calls stkt_create_stk_ctr_pool()
but doesn't check its return value, so if the pool creation fails, the
process still starts, which is not correct. This patch adds a check for
the return value to make sure we fail to start in this case. This was
not an issue before 3.3 because the function was called as a post-check
handler which did check for errors in the returned values.

src/stick_table.c

index 6cc9e177cb5da9983a1cc297d7fffce66e3da0ff..5f60ef8e39c153a48ebb7f710f4e7a2e8a638f64 100644 (file)
@@ -5968,7 +5968,9 @@ static void stkt_late_init(void)
        f = find_sample_fetch("src", strlen("src"));
        if (f)
                smp_fetch_src = f->process;
-       stkt_create_stk_ctr_pool();
+
+       if (stkt_create_stk_ctr_pool() & (ERR_ABORT | ERR_FATAL))
+               exit(1); // error already reported by the function
 
        for (i = 0; i < CONFIG_HAP_TBL_BUCKETS; i++) {
                MT_LIST_INIT(&per_bucket[i].toadd_tables);