]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cli: fix _getsocks with musl libc
authorWilliam Lallemand <wlallemand@haproxy.org>
Mon, 3 Jan 2022 18:43:41 +0000 (19:43 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 3 Jan 2022 18:50:34 +0000 (19:50 +0100)
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.

include/haproxy/compat.h

index ed7e8705140d04b73257fa0440ab25d1303d1e27..35a38d73cdb21057c4fc55f85f2b2187a23c558f 100644 (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 */