From: William Lallemand Date: Mon, 3 Jan 2022 18:43:41 +0000 (+0100) Subject: BUG/MINOR: cli: fix _getsocks with musl libc X-Git-Tag: v2.6-dev1~186 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=148d7a030156ca927e744013dd6fc32b473c1ef6;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/haproxy/compat.h b/include/haproxy/compat.h index ed7e870514..35a38d73cd 100644 --- a/include/haproxy/compat.h +++ b/include/haproxy/compat.h @@ -287,9 +287,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 */