nuttx/net/pkt
Daniel P. Carvalho 432717c34c net/pkt: clear pending TX IOB reference when poll callback finishes
pkt_poll() records the outgoing IOB in pkt_conn->pendiob so that any
synchronous TX tap or loopback executed during the driver callback can
skip delivering the packet back to the sending socket.

Previously, pendiob was never cleared upon TX completion and would
linger across transmissions as a dangling pointer. Because the IOB
pool is small and recycled quickly (LIFO), a subsequent incoming
packet from the network frequently reused the same IOB buffer address,
causing pkt_in() to drop legitimate RX packets as false self-echoes.

Drop the pendiob reference immediately after callback(dev) returns in
devif_poll_pkt_connections(), ensuring the pointer never outlives the
transmission cycle.

Also fixes a pre-existing nxstyle alignment issue in devif_poll.c
IPv6 version-check block (unrelated nerr() call), since this file is
now touched and CI enforces style on the whole file.

Suggested-by: zhhyu7
Assisted-by: Gemini:gemini-3.8-flash-medium
Signed-off-by: Daniel P. Carvalho <danieloak@gmail.com>
2026-09-17 09:44:19 -03:00
..
CMakeLists.txt net/pkt: add nonblock mode and send buffered support 2025-12-10 23:44:14 +08:00
Kconfig net/ethernet: fix compilation issues 2025-12-29 23:31:51 +08:00
Make.defs net/pkt: add nonblock mode and send buffered support 2025-12-10 23:44:14 +08:00
pkt.h net: make the sendmsg param type consistent with posix specification 2026-01-16 21:11:39 +08:00
pkt_callback.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pkt_conn.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pkt_finddev.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
pkt_getsockopt.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pkt_input.c net/pkt: clear pending TX IOB reference when poll callback finishes 2026-09-17 09:44:19 -03:00
pkt_netpoll.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pkt_poll.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pkt_recvmsg.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pkt_sendmsg_buffered.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pkt_sendmsg_unbuffered.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pkt_setsockopt.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pkt_sockif.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00