From 5ca0d91e56de1511680d31c6cd65761db56f4a7d Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Mon, 3 Jan 2022 19:43:41 +0100 Subject: [PATCH] BUG/MINOR: cli: fix _getsocks with musl libc In ticket #1413, the transfer of FDs couldn't correctly work on alpine linux. After a few tests with musl on another distribution it seems to be a limitation of this libc. The number of FD that could be sent per sendmsg was set to 253, which does not seem to work with musl, decreasing it 252 seems to work better, so lets set this value everywhere since it does not have that much impact. This must be backported in every maintained version. (cherry picked from commit 148d7a030156ca927e744013dd6fc32b473c1ef6) Signed-off-by: Willy Tarreau (cherry picked from commit ac1d29e8a67447941b4b1606be865dd6bbdd2b54) Signed-off-by: Willy Tarreau (cherry picked from commit 6b83f770a45faec876f207123fb358b1b79dfbea) Signed-off-by: Willy Tarreau --- include/haproxy/compat.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/haproxy/compat.h b/include/haproxy/compat.h index b029ae4..82b064b 100644 --- a/include/haproxy/compat.h +++ b/include/haproxy/compat.h @@ -272,9 +272,10 @@ typedef struct { } empty_t; #endif /* Max number of file descriptors we send in one sendmsg(). Linux seems to be - * able to send 253 fds per sendmsg(), not sure about the other OSes. + * able to send 253 fds per sendmsg(), however musl is limited to 252, not sure + * about the other OSes. */ -#define MAX_SEND_FD 253 +#define MAX_SEND_FD 252 #endif /* _HAPROXY_COMPAT_H */ -- 1.7.10.4