zephyr/subsys/net/lib/sockets
Robert Lubos 94b1f443ac net: sockets: Allocate FD after receiving connection in accept()
Allocating FD before pulling the new connection from the fifo can lead
to busy looping in certain cases. If the application keeps calling
accept() on a listening socket after failing to allocate new FD for the
incoming connection, it'll start busy looping, as will report POLLIN in
such case (as the new connection is still on the queue), but it'll
consistently fail with ENFILE.

This can be avoided by trying to allocate new file descriptor only after
new connection has been pulled from the fifo. That way, if we fail to
allocate the file descriptor, the incoming connection will be dropped,
which seems correct given we don't have enough resources to service it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-11 13:11:04 -04:00
..
CMakeLists.txt Revert "net: sockets: move select() implementation to zvfs" 2024-07-03 15:03:05 -04:00
getaddrinfo.c build: namespace the generated headers with zephyr/ 2024-05-28 22:03:55 +02:00
getnameinfo.c
Kconfig Revert "net: sockets: move poll implementation to zvfs" 2024-07-03 15:03:05 -04:00
socket_dispatcher.c fdtable: replace z_ prefix with zvfs_ for fdtable.h functions 2024-06-26 12:33:02 +02:00
socket_obj_core.c posix: deprecate POSIX_MAX_FDS and add POSIX_DEVICE_IO 2024-06-04 16:27:12 -05:00
socket_offload.c
socketpair.c fdtable: replace z_ prefix with zvfs_ for fdtable.h functions 2024-06-26 12:33:02 +02:00
sockets_can.c fdtable: replace z_ prefix with zvfs_ for fdtable.h functions 2024-06-26 12:33:02 +02:00
sockets_internal.h net: sockets: Refactor accept() to support objcore better 2024-01-17 09:55:40 +01:00
sockets_misc.c build: namespace the generated headers with zephyr/ 2024-05-28 22:03:55 +02:00
sockets_net_mgmt.c fdtable: replace z_ prefix with zvfs_ for fdtable.h functions 2024-06-26 12:33:02 +02:00
sockets_packet.c fdtable: replace z_ prefix with zvfs_ for fdtable.h functions 2024-06-26 12:33:02 +02:00
sockets_select.c Revert "net: sockets: move select() implementation to zvfs" 2024-07-03 15:03:05 -04:00
sockets_service.c net: sockets: Remove async service support 2024-07-10 11:36:59 +02:00
sockets_tls.c net: sockets: tls: Fix iov_len comparison in sendmsg() 2024-06-26 12:39:51 +02:00
sockets.c net: sockets: Allocate FD after receiving connection in accept() 2024-07-11 13:11:04 -04:00