]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: protocol: retrieve the family-specific fields from the family
authorWilly Tarreau <w@1wt.eu>
Fri, 4 Sep 2020 06:15:31 +0000 (08:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 20:08:07 +0000 (22:08 +0200)
commitf1f660978cec83b8fcad00de3b09fb53c7ea6972
tree4b9d49553858d780848fb74fa986ae482e5555ce
parentb0254cb36111c2084fedd21155161a2c96a14037
MINOR: protocol: retrieve the family-specific fields from the family

We now take care of retrieving sock_family, l3_addrlen, bind(),
addrcmp(), get_src() and get_dst() from the protocol family and
not just the protocol itself. There are very few places, this was
only seldom used. Interestingly in sock_inet.c used to rely on
->sock_family instead of ->sock_domain, and sock_unix.c used to
hard-code PF_UNIX instead of using ->sock_domain.

Also it appears obvious we have something wrong it the protocol
selection algorithm because sock_domain is the one set to the custom
protocols while it ought to be sock_family instead, which would avoid
having to hard-code some conversions for UDP namely.
include/haproxy/connection.h
src/protocol.c
src/sock.c
src/sock_inet.c
src/sock_unix.c