From: Willy Tarreau Date: Tue, 29 Nov 2022 15:08:35 +0000 (+0100) Subject: BUG/MINOR: peers: always initialize the stksess shard value X-Git-Tag: v2.7.0~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e548a7af45d5d460cfd9779bd451736a9759c270;p=thirdparty%2Fhaproxy.git 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. --- 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;