BUG/MINOR: listener: enforce all_threads_mask on bind_thread on init
authorWilly Tarreau <w@1wt.eu>
Wed, 12 Feb 2020 09:15:34 +0000 (10:15 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 12 Feb 2020 09:27:45 +0000 (10:27 +0100)
commit507e044a18994fc8cc087ace12ab5feb553f9670
tree01b35354e9c0f649786130c20e9532165928a20a
parentb57aba114b045be6eb3d98f1f61a76ad498e46c4
BUG/MINOR: listener: enforce all_threads_mask on bind_thread on init

When intializing a listener, let's make sure the bind_thread mask is
always limited to all_threads_mask when inserting the FD. This will
avoid seeing listening FDs with bits corresponding to threads that are
not active (e.g. when using "bind ... process 1/even"). The side effect
is very limited, all that was identified is that atomic operations are
used in fd_update_events() when not necessary. It's more a matter of
long-term correctness in practice.

This fix might be backported as far as 1.8 (then proto_sockpair must
be dropped).

(cherry picked from commit 0948a781fce19a032b71e65239d6bc5d10c97522)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/proto_sockpair.c
src/proto_tcp.c
src/proto_uxst.c