zephyr/subsys/net/lib
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
..
capture includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
coap net: coap: add support for Echo option (RFC 9175) 2023-10-20 15:09:44 +02:00
config net: l2: ieee802154: security config 2023-09-29 16:27:31 +02:00
dns random: Rename random header 2023-10-10 14:23:50 +03:00
http net: http: define http service and resource iterable sections 2023-03-08 13:57:13 +00:00
lwm2m net: lwm2m: Check access rights on composite operations 2023-10-20 15:12:39 +02:00
mqtt net: mqtt: close tcp socket after websocket_disconnect 2023-06-19 09:18:45 +01:00
mqtt_sn net: mqtt-sn: Active mqtt-sn process work when buffer run out 2023-09-19 15:20:09 +01:00
shell net: shell: Fix TCP connect behavior 2023-10-23 16:08:37 +02:00
sntp net: sntp: support building without NET_SOCKETS_POSIX_NAMES 2023-04-24 09:23:17 -04:00
sockets net: socket: mgmt: Check buf size in recvfrom() 2023-10-12 10:33:36 +03:00
socks includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
tftp net: tftp: Add client context 2023-02-28 10:29:30 +01:00
tls_credentials net: lib: tls_credentials: earlier initialisation 2023-07-12 14:50:09 +02:00
utils net: sntp: support building without NET_SOCKETS_POSIX_NAMES 2023-04-24 09:23:17 -04:00
websocket random: Rename random header 2023-10-10 14:23:50 +03:00
zperf net: lib: zperf: fix compiler warning 2023-10-03 15:21:34 +01:00
CMakeLists.txt net: shell: Move the shell code to subsys/net/lib/shell 2023-10-23 10:40:28 +02:00
Kconfig net: conn_mgr: Reorganize files 2023-05-11 12:15:44 +02:00