This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 6771282ab067ace476adcb41f44957ba4eec9f65 Author: gaohedong <[email protected]> AuthorDate: Tue Nov 4 22:50:59 2025 +0800 net/pkt: fix issue for pkt loopback The pkt protocol stack has not cleared conn ->pendiob after sending data. If this iob buffer is used when receiving data from the lowerhalf, the data will be dropped by the pkt stack, resulting in packet loss issues. To solve this problem, we add a judgment condition. Signed-off-by: gaohedong <[email protected]> --- net/pkt/pkt_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/pkt/pkt_input.c b/net/pkt/pkt_input.c index 8cd0a4a1c7e..87d61249c00 100644 --- a/net/pkt/pkt_input.c +++ b/net/pkt/pkt_input.c @@ -153,7 +153,7 @@ static int pkt_in_(FAR struct net_driver_s *dev, bool loopback) while ((conn = pkt_active(dev, conn, loopback)) != NULL) { - if (conn->pendiob == dev->d_iob) + if (loopback && conn->pendiob == dev->d_iob) { /* Do not read back the packet sent by oneself. pendiob is * released by devif_poll_pkt_connections() once this tap run
