BUG/MEDIUM: uxst: fix outgoing abns address family in connect()
authorWilly Tarreau <w@1wt.eu>
Fri, 21 Feb 2025 06:53:21 +0000 (07:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 21 Feb 2025 07:01:59 +0000 (08:01 +0100)
commit946048e7ee03eafac94c9e041709876315220a24
tree293adb083b582ddf43f8fa35591bbc6ffc41ff50
parentf595db184bcdc7e8d3063f2f13fe41725ff11971
BUG/MEDIUM: uxst: fix outgoing abns address family in connect()

Since we reworked the unix socket families in order to support custom
addresses for different addressing schemes, we've been using extra
values for the ss_family field in sockaddr_storage. These ones have
to be adjusted before calling bind() or connect(). It turns out that
after the abns/abnsz updates in 3.1, the connect() code was not adjusted
to take care of the change, resulting in AF_CUST_ABNS or AF_CUST_ABNSZ
to be placed in the address that was passed to connect().

The right approach is to locally copy the address, get its length,
fixup the family and use the fixed value and length for connect().

This must be backported to 3.1. Many thanks for @Mewp for reporting
this issue in github issue #2875.

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