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.
This commit is contained in:
William Lallemand 2022-01-03 19:43:41 +01:00
parent ae5c42f4d0
commit 148d7a0301

View File

@ -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 */