]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: protocol: properly assign the sock_domain and sock_family
authorWilly Tarreau <w@1wt.eu>
Fri, 9 Aug 2024 16:59:46 +0000 (18:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 21 Aug 2024 14:46:15 +0000 (16:46 +0200)
commit732913f848127fd990bbfb912a6e004d27b45fd0
tree73cd51835c67c614f412e28c0baeec80e44515b9
parent67bf1d6c9e9410424cc5adc0a77477a820a14ad5
MINOR: protocol: properly assign the sock_domain and sock_family

When we finally split sock_domain from sock_family in 2.3, something
was not cleanly finished. The family is what should be stored in the
address while the domain is what is supposed to be passed to socket().
But for the custom addresses, we did the opposite, just because the
protocol_lookup() function was acting on the domain, not the family
(both of which are equal for non-custom addresses).

This is an API bug but there's no point backporting it since it does
not have visible effects. It was visible in the code since a few places
were using PF_UNIX while others were comparing the domain against AF_MAX
instead of comparing the family.

This patch clarifies this in the comments on top of proto_fam, addresses
the indexing issue and properly reconfigures the two custom families.
include/haproxy/protocol-t.h
src/proto_rhttp.c
src/proto_sockpair.c
src/protocol.c
src/sock.c