MINOR: sock: implement sock_find_compatible_fd()
authorWilly Tarreau <w@1wt.eu>
Fri, 28 Aug 2020 14:49:41 +0000 (16:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 28 Aug 2020 16:51:36 +0000 (18:51 +0200)
commit2d34a710b1423c5f698b060f48db8e97eb981f5e
tree2b017ce4410aaa417bb897881e2797dec4277551
parenta6473ede5c5cd6b3f3bb0746e13586a7ac961650
MINOR: sock: implement sock_find_compatible_fd()

This is essentially a merge from tcp_find_compatible_fd() and
uxst_find_compatible_fd() that relies on a listener's address and
compare function and still checks for other variations. For AF_INET6
it compares a few of the listener's bind options. A minor change for
UNIX sockets is that transparent mode, interface and namespace used
to be ignored when trying to pick a previous socket while now if they
are changed, the socket will not be reused. This could be refined but
it's still better this way as there is no more risk of using a
differently bound socket by accident.

Eventually we should not pass a listener there but a set of binding
parameters (address, interface, namespace etc...) which ultimately will
be grouped into a receiver. For now this still doesn't exist so let's
stick to the listener to break dependencies in the rest of the code.
include/haproxy/sock.h
src/proto_tcp.c
src/proto_uxst.c
src/sock.c