]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: protocol: move the global reuseport flag to the protocols
authorWilly Tarreau <w@1wt.eu>
Sat, 22 Apr 2023 13:09:07 +0000 (15:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 23 Apr 2023 07:46:15 +0000 (09:46 +0200)
commit785b89f5514082facf8b9061568460e9834f61d0
tree70191836986ab26654e6dea8474783d14f8c98d9
parent65df7e028da2d86d9769f2ba03bdf1d110c2a44c
MINOR: protocol: move the global reuseport flag to the protocols

Some protocol support SO_REUSEPORT and others not. Some have such a
limitation in the kernel, and others in haproxy itself (e.g. sock_unix
cannot support multiple bindings since each one will unbind the previous
one). Also it's really protocol-dependent and not just family-dependent
because on Linux for some time it was supported for TCP and not UDP.

Let's move the definition to the protocols instead. Now it's preset in
tcp/udp/quic when SO_REUSEPORT is defined, and is otherwise left unset.
The enabled() config condition test validates IPv4 (generally sufficient),
and -dR / noreuseport all protocols at once.
include/haproxy/global-t.h
include/haproxy/protocol-t.h
src/cfgcond.c
src/cfgparse-global.c
src/haproxy.c
src/proto_quic.c
src/proto_tcp.c
src/proto_udp.c
src/sock_inet.c