zephyr/subsys/net
Robert Lubos 2c75070360 net: sockets: tcp: Fix possible race between connect/recv
Installing recv callback with net_context_recv() after
net_context_connect() left an opening for a possible race - in case the
server send some data immediately after establishing TCP connection, and
Zephyr did not manage to install the callback on time, the data would be
lost, corrupting the stream.

This can be avoided, by installing the recv callback before the
connection is triggered. As net_context_recv() called w/o timeout only
registers the callback function, it should have no negative impact. The
only change on the TCP side is when the connection is closed - in case
TCP is in connect stage, do not call the recv callback (before this
change it'd be NULL at that point).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-05-26 09:55:13 -04:00
..
conn_mgr iterable_sections: move to specific header 2023-05-22 10:42:30 +02:00
ip net: sockets: tcp: Fix possible race between connect/recv 2023-05-26 09:55:13 -04:00
l2 net: l2: ieee802154: move variable declaration to start of block 2023-05-24 16:41:57 +02:00
lib net: sockets: tcp: Fix possible race between connect/recv 2023-05-26 09:55:13 -04:00
pkt_filter subsystems: migrate includes to <zephyr/...> 2022-05-09 12:07:35 +02:00
buf_simple.c net: buf: Factor out net_buf_simple to separate source file 2023-03-15 10:50:16 +01:00
buf.c net: buf: cleanup net_buf_pool use of iterable section 2023-04-20 10:50:04 +02:00
CMakeLists.txt net: conn_mgr: Reorganize files 2023-05-11 12:15:44 +02:00
hostname.c includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
Kconfig net: conn_mgr: Reorganize files 2023-05-11 12:15:44 +02:00
Kconfig.hostname
Kconfig.template.log_config.default.net
Kconfig.template.log_config.net