nuttx/net/devif
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/net_initialize: remove the empty functions that are not needed 2025-12-25 09:50:40 +08:00
devif.h devif_poll: only call the corresponding xxx_poll when there is data to be sent 2026-01-02 00:04:16 +08:00
devif_callback.c net/devif: harden devif_conn_event() against list mutation 2026-06-25 15:19:02 -03:00
devif_filesend.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
devif_forward.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
devif_iobsend.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
devif_loopback.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
devif_poll.c net/pkt: clear pending TX IOB reference when poll callback finishes 2026-09-17 09:44:19 -03:00
devif_send.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
ipv4_input.c net/ipv4: Forward fragments before local reassembly 2026-08-01 17:40:07 -03:00
ipv6_input.c net/ipfilter: Reassemble IPv6 fragments before filtering 2026-08-01 17:40:07 -03:00
Make.defs net/net_initialize: remove the empty functions that are not needed 2025-12-25 09:50:40 +08:00