daniel-p-carvalho commented on code in PR #20148:
URL: https://github.com/apache/nuttx/pull/20148#discussion_r4031044910


##########
net/pkt/pkt.h:
##########
@@ -105,6 +105,10 @@ struct pkt_conn_s
   struct iob_queue_s readahead;   /* Read-ahead buffering */
 
   FAR struct iob_s  *pendiob;     /* The iob currently being sent */
+  uint16_t           pendiob_len; /* Length of pendiob, to disambiguate

Review Comment:
   Hi @zhhyu7,
   
   Thank you very much for the insightful suggestion!
   
   Your observation that `pendiob` should not outlive the synchronous driver 
poll/tap callback was spot-on. Dropping the reference immediately after 
`callback(dev)` in `devif_poll_pkt_connections()` eliminates the dangling 
pointer and prevents subsequent recycled IOBs from being falsely dropped in 
`pkt_in()`.
   
   I tested this on real hardware (STM32F4 Ethernet with PTP P2P IEEE 1588). 
The Pdelay request/response exchanges are now processed properly and the clock 
synchronization ran stably over an extended test run, confirming that the false 
self-echo drops are resolved. It also allowed removing the `pendiob_len` 
tracking field altogether, keeping the structure cleaner.
   
   I have updated the PR accordingly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to