socket: bump listen() backlog to INT_MAX everywhere

This is a rework of #24764 by Cristian Rodríguez
<crodriguez@owncloud.com>, which stalled.

Instead of assigning -1 we'll use a macro defined to INT_MAX however.
This commit is contained in:
Lennart Poettering
2023-06-13 14:17:25 +02:00
parent 39b5f49f28
commit 768fcd779f
12 changed files with 28 additions and 20 deletions
+7
View File
@@ -354,3 +354,10 @@ int connect_unix_path(int fd, int dir_fd, const char *path);
* protocol mismatch. */
int socket_address_parse_unix(SocketAddress *ret_address, const char *s);
int socket_address_parse_vsock(SocketAddress *ret_address, const char *s);
/* libc's SOMAXCONN is defined to 128 or 4096 (at least on glibc). But actually, the value can be much
* larger. In our codebase we want to set it to the max usually, since noawadays socket memory is properly
* tracked by memcg, and hence we don't need to enforce extra limits here. Moreover, the kernel caps it to
* /proc/sys/net/core/somaxconn anyway, thus by setting this to unbounded we just make that sysctl file
* authoritative. */
#define SOMAXCONN_DELUXE INT_MAX