]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: proto: duplicate receivers marked RX_F_MUST_DUP
authorWilly Tarreau <w@1wt.eu>
Mon, 27 Feb 2023 15:39:32 +0000 (16:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 21 Apr 2023 15:41:26 +0000 (17:41 +0200)
commit0e1aaf4e78ad759e452b9459ebbaaa661fe86b25
treee8e44cae08fdc5aced9d99b920057eae6e8b465e
parente4c36aa8a165e12b6eb7d7817b7370793e32229b
MEDIUM: proto: duplicate receivers marked RX_F_MUST_DUP

The different protocol's ->bind() function will now check the receiver's
RX_F_MUST_DUP flag to decide whether to bind a fresh new listener from
scratch or reuse an existing one and just duplicate it. It turns out
that the existing code already supports reusing FDs since that was done
as part of the FD passing and inheriting mechanism. Here it's not much
different, we pass the FD of the reference receiver, it gets duplicated
and becomes the new receiver's FD.

These FDs are also marked RX_F_INHERITED so that they are not exported
and avoid being touched directly (only the reference should be touched).
src/proto_sockpair.c
src/sock_inet.c
src/sock_unix.c