zephyr/subsys/net
Robert Lubos 05361edb1b net: shell: Fix TCP connect behavior
Fix two issues with net tcp command:

* The `net tcp` commands are still based on net_context API. For TCP,
  the API caller (net shell) should add one extra reference to the
  allocated net context, to prevent premature context release in case of
  connection teardown. Currently that was not the case, and the context
  was released too early, resulting in missing final ACK from the Zephyr
  side on connection close.

* The net context API should not be called from the registered connect
  callback, as this creates a temporary deadlock situation. The
  net_context_connect() function blocks until the connection is
  established, or an error or timeout occurs. For that time the
  net_context mutex is being locked. In case of connection error (for
  example after receiving RST packet) the connect callback is called,
  indicating an error. If we try to call net_context API from within, a
  deadlock situation takes place, as the context mutex is still locked
  by the net_context_connect() (called from the shell thread). This
  blocks the further execution of the TCP stack and can result in an
  unexpected behavior (like for example retransmitting the SYN packet,
  which takes place from yet another thread, TCP work queue).
  Fix this, by releasing the net context not from the callback directly,
  but based on the return value from net_context_connect().

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-10-23 16:08:37 +02:00
..
conn_mgr net: conn_mgr: Write documentation 2023-09-28 15:11:14 +02:00
ip net: shell: Move the shell code to subsys/net/lib/shell 2023-10-23 10:40:28 +02:00
l2 net: wifi: Fix compile error when -Werror -Wextra are set 2023-10-23 11:06:23 +02:00
lib net: shell: Fix TCP connect behavior 2023-10-23 16:08:37 +02:00
pkt_filter net: pkt_filter: Introduce additional hooks for pkt_filter 2023-07-10 09:27:47 +02:00
buf.c subsys/net: move to timepoint API 2023-07-25 09:12:26 +02:00
buf_simple.c net: buf: Factor out net_buf_simple to separate source file 2023-03-15 10:50:16 +01:00
CMakeLists.txt net: conn_mgr: Write documentation 2023-09-28 15:11:14 +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 net: hostname: Update unique hostname on link address change 2021-01-13 17:50:32 +02:00
Kconfig.template.log_config.default.net kconfig: Clean up header comments and make them consistent 2019-11-04 17:31:27 -05:00
Kconfig.template.log_config.net kconfig: Clean up header comments and make them consistent 2019-11-04 17:31:27 -05:00