]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: thread: fix extraneous shift in the thread_set parser
authorWilly Tarreau <w@1wt.eu>
Mon, 6 Feb 2023 17:01:50 +0000 (18:01 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Feb 2023 17:01:50 +0000 (18:01 +0100)
commitf91ab7a08c5ef54b4c268373e250abdae0820960
tree4edb427a0333d1895e4168cc8c51beaa65633ce9
parentd97d1d7c7c654d1a9e2e712ac7736420fe2d6ea5
BUG/MEDIUM: thread: fix extraneous shift in the thread_set parser

AurĂ©lien reported a bug making a statement such as "thread 2-2" fail for
a config made of exactly 2 threads. What happens is that the parser for
the "thread" keyword scans a range of thread numbers from either 1..64
or 0,-1,-2 for special values, and presets the bit masks accordingly in
the thread set, except that due to the 1..64 range, the shift length must
be reduced by one. Not doing this causes empty masks for single-bit values
that are exactly equal to the number of threads in the group and fails to
properly parse.

No backport is needed as this was introduced in 2.8-dev3 by commit
bef43dfa6 ("MINOR: thread: add a simple thread_set API").
src/thread.c