zephyr/subsys
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
..
bindesc bindesc: Use UTC time by default and comply with ISO-8601 2023-10-06 13:37:02 +03:00
bluetooth Bluetooth: ISO: use IN_RANGE for CIG create parameters 2023-10-23 15:22:10 +02:00
canbus canbus: isotp: rename ctx function parameters to rctx/sctx 2023-09-21 11:54:11 +02:00
console includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
debug debug: coredump: add name for backend and dump options 2023-10-23 15:22:37 +02:00
demand_paging kernel: Modify the signature of k_mem_slab_free() 2023-09-03 18:20:59 -04:00
dfu mgmt/MCUmgr/grp/img: Add support for three image configuration 2023-09-22 15:13:31 +02:00
disk subsys/disk: No need of runtime intialization for disk access part 2023-03-13 18:34:40 +00:00
dsp zdsp: add ARC DSPLIB backend for zdsp 2023-02-21 15:06:06 +01:00
emul emul: Don't panic if matching emul can't be found 2023-07-18 11:09:08 +00:00
fb fb: cfb: Remove unused value 2023-08-14 18:08:59 +00:00
fs fs: fix missing semicolon in fuse_fs_access.c 2023-10-18 15:50:50 +03:00
input input: longpress: use POST_KERNEL level 2023-09-15 16:04:19 +02:00
ipc ipc: backend: rpmsg: Add support for POSIX arch 2023-10-23 10:37:33 +02:00
jwt random: Rename random header 2023-10-10 14:23:50 +03:00
llext llext: Fix wrong check 2023-10-20 15:20:35 +02:00
logging logging: Fix misuse of const and k_tid_t 2023-10-20 15:08:42 +02:00
lorawan random: Rename random header 2023-10-10 14:23:50 +03:00
mem_mgmt dt: Make zephyr,memory-attr a capabilities bitmask 2023-09-15 12:46:54 +02:00
mgmt mgmt: mcumgr: grp: fs_mgmt: Select CRC if hash/checksum is enabled 2023-10-23 12:15:41 +02:00
modbus modbus: add support for defining custom functions 2023-09-29 13:05:42 +02:00
modem modem: modem_cmux: Increase modem cmux buf size 2023-10-11 18:57:11 +03:00
net net: shell: Fix TCP connect behavior 2023-10-23 16:08:37 +02:00
pm pm: policy: add check for device busy in policy 2023-09-15 14:51:50 -04:00
portability kernel: Re-factor k_mem_slab definition 2023-09-30 08:04:14 +03:00
random random: timer: Use build constant for seed 2023-10-13 10:03:53 +03:00
retention retention: blinfo: Fix issue with crash writing to keys 2023-10-12 11:53:21 +01:00
rtio rtio: Remove unused Kconfigs for executors 2023-10-06 09:18:43 +02:00
sd sd: add check for maximum supported voltage by host controller 2023-09-29 16:29:00 +02:00
sensing sensing: sensor_mgmt: s/device.h/init.h 2023-08-29 12:17:24 +01:00
settings settings: shell: Add value type and allow for strings to be used 2023-09-22 14:02:02 +02:00
shell dts: drop HAS_DTS 2023-10-20 12:18:17 -07:00
sip_svc subsystem: sip_svc: Reduce the max timeout to 1 second. 2023-09-15 09:26:49 +02:00
stats stats: shell: enable the stats shell if both stats and shell are enabled 2022-10-12 06:46:34 +02:00
storage storage: rename shadow variables 2023-08-22 11:39:58 +02:00
task_wdt task_wdt: fix race condition for task_wdt_add function 2023-10-09 16:10:00 +03:00
testsuite doc: ztest: adapt ztest docs 2023-10-20 15:04:29 +02:00
timing subsystems: migrate includes to <zephyr/...> 2022-05-09 12:07:35 +02:00
tracing kernel: rename z_current_get() to k_sched_current_thread_query() 2023-09-28 16:15:46 +02:00
usb usb: device: cdc_acm: block in uart_poll_out() routine 2023-10-23 11:48:44 +02:00
zbus zbus: Add Message subscriber 2023-09-27 20:03:43 +03:00
CMakeLists.txt llext: Linkable loadable extensions 2023-09-29 20:50:38 -04:00
Kconfig llext: Linkable loadable extensions 2023-09-29 20:50:38 -04:00