]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: port_range: Make the ring buffer lock-free.
authorOlivier Houchard <ohouchard@haproxy.com>
Mon, 29 Apr 2019 16:52:06 +0000 (18:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 30 Apr 2019 13:10:17 +0000 (15:10 +0200)
commit07425de71777b688e77a9c70a7088c13e66e41e9
treeb2894902f827dd6f74f14be99edbb28b52260afe
parent9ce62b5498b27fbf4217d9c25779d5b2ceca23f2
BUG/MEDIUM: port_range: Make the ring buffer lock-free.

Port range uses a ring buffer, and unfortunately, when making haproxy
multithreaded, it's been overlooked, and the ring buffer is not thread-safe.
When specifying a source range, 2 or more threads could pick the same
port, and of course only one of them could use the port, the others would
always fail the connection.
To fix this, make it a lock-free ring buffer. This is easier than usual
because we know the ring buffer can never be full.

This should be backported to 1.8 and 1.9.
include/proto/port_range.h
include/types/port_range.h