]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: proto_uxst: take in account server namespace
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Tue, 23 Apr 2024 21:11:15 +0000 (23:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 30 Apr 2024 19:38:18 +0000 (21:38 +0200)
commit84babc93ce4def6ef8643a66e486be1923cab830
tree3d26b1bd83c268483f090d60feaebf25bf53f6cd
parenta0b5324cff06fd0574ffd1bfe36386be302e7a3d
MEDIUM: proto_uxst: take in account server namespace

As UNIX Domain sockets could be attached to Linux namespaces (see more details
about it from the Linux kernel patch set below:

https://lore.kernel.org/netdev/m1hbl7hxo3.fsf@fess.ebiederm.org),

it is better to use sock_create_server_socket() in UNIX stream protocol
implementation, as this function calls my_socket_at() and the latter takes
in account server network namespace, which could be configured as in example
below:

       backend be_bar
                ...
                server rpicam0 /run/ustreamer.sock namespace foonet

So, for UNIX Domain socket, used as an address of some backend server, this
patch makes possible to perform connect() to this backend server from the same
network namespace, where the server is running, or where its listening socket
was created.

Using sock_create_server_socket() in UNIX stream protocol implementation also
makes the code of uxst_connect_server() more uniform with tcp_connect_server()
and quic_connect_server().
src/proto_uxst.c