]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: sock: also restore effective unix family in get_{src,dst}()
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 29 Oct 2024 10:38:11 +0000 (11:38 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Tue, 29 Oct 2024 11:15:03 +0000 (12:15 +0100)
commitd879bf6600f4518f974766340e0d55ae83484f1e
tree4bbf1d41ae0eb9d40ffd36d61a16676b3de2b1cb
parentae64444303fbdd041bf7421fac7119031ecd0f63
MEDIUM: sock: also restore effective unix family in get_{src,dst}()

As in previous commit, let's push the logic a bit further in order to
properly restore the effective UNIX socket type when leveraging
get_src() and get_dst() sock functions, since they rely on getpeername()
and getsockname() under the hood, both of which will actually loose the
effective family and return AF_UNIX for all our custom UNIX sockets.

To do this, add sock_restore_unix_family() helper function from the logic
implemented in the previous commit, and call this function from get_src()
and get_dst() in case of unix socket prior to returning.
src/sock.c