]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: protocol: make abns a custom unix socket address family
authorWilly Tarreau <w@1wt.eu>
Fri, 9 Aug 2024 16:48:14 +0000 (18:48 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Tue, 29 Oct 2024 11:14:25 +0000 (12:14 +0100)
commit78ac312bbdaa3039f50710886c285ded31744152
tree96096862ed21d1bc6e43c6c3c095680cf3ab8875
parent596db3ef86844617565a0b4b4ce8358fe6537d87
MEDIUM: protocol: make abns a custom unix socket address family

This is a pre-requisite to adding the abnsz socket address family:

in this patch we make use of protocol API rework started by 732913f
("MINOR: protocol: properly assign the sock_domain and sock_family") in
order to implement a dedicated address family for ABNS sockets (based on
UNIX parent family).

Thanks to this, it will become trivial to implement a new ABNSZ (for abns
zero) family which is essentially the same as ABNS but with a slight
difference when it comes to path handling (ABNS uses the whole sun_path
length, while ABNSZ's path is zero terminated and evaluation stops at 0)

It was verified that this patch doesn't break reg-tests and behaves
properly (tests performed on the CLI with show sess and show fd).

Anywhere relevant, AF_CUST_ABNS is handled alongside AF_UNIX. If no
distinction needs to be made, real_family() is used to fetch the proper
real family type to handle it properly.

Both stream and dgram were converted, so no functional change should be
expected for this "internal" rework, except that proto will be displayed
as "abns_{stream,dgram}" instead of "unix_{stream,dgram}".

Before ("show sess" output):
  0x64c35528aab0: proto=unix_stream src=unix:1 fe=GLOBAL be=<NONE> srv=<none> ts=00 epoch=0 age=0s calls=1 rate=0 cpu=0 lat=0 rq[f=848000h,i=0,an=00h,ax=] rp[f=80008000h,i=0,an=00h,ax=] scf=[8,0h,fd=21,rex=10s,wex=] scb=[8,1h,fd=-1,rex=,wex=] exp=10s rc=0 c_exp=

After:
  0x619da7ad74c0: proto=abns_stream src=unix:1 fe=GLOBAL be=<NONE> srv=<none> ts=00 epoch=0 age=0s calls=1 rate=0 cpu=0 lat=0 rq[f=848000h,i=0,an=00h,ax=] rp[f=80008000h,i=0,an=00h,ax=] scf=[8,0h,fd=22,rex=10s,wex=] scb=[8,1h,fd=-1,rex=,wex=] exp=10s rc=0 c_exp=

Co-authored-by: Aurelien DARRAGON <adarragon@haproxy.com>
18 files changed:
include/haproxy/protocol-t.h
include/haproxy/sock_unix.h
include/haproxy/tools.h
src/cli.c
src/connection.c
src/extcheck.c
src/frontend.c
src/hlua.c
src/hlua_fcn.c
src/log.c
src/peers.c
src/proto_uxdg.c
src/proto_uxst.c
src/session.c
src/sock_unix.c
src/stats-proxy.c
src/stream.c
src/tools.c