From e548a7af45d5d460cfd9779bd451736a9759c270 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 29 Nov 2022 16:08:35 +0100 Subject: [PATCH] BUG/MINOR: peers: always initialize the stksess shard value We need to initialize the shard value in __stksess_init() because there is not necessarily a key to make it happen later, resulting in an uninitialized shard value appearing in the entry, typically when entries are learned from peers. This fixes commit 36d156564 ("MINOR: peers: Support for peer shards"), no backport is needed. Note however that it is not sufficient to completely fix the peers code, the shard value remains zero because the setting of the key was open-coded in the peers code and these parts were not identified when adding support for shards. --- src/stick_table.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stick_table.c b/src/stick_table.c index 3ca2c887f5..152abf7e22 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -199,6 +199,7 @@ static struct stksess *__stksess_init(struct stktable *t, struct stksess * ts) { memset((void *)ts - t->data_size, 0, t->data_size); ts->ref_cnt = 0; + ts->shard = 0; ts->key.node.leaf_p = NULL; ts->exp.node.leaf_p = NULL; ts->upd.node.leaf_p = NULL; -- 2.47.3