You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] [netdev] ping still applies delay after the last packet and calls rt_thread_delay(0) returning -RT_EINVAL #11865
In netdev_cmd_ping(), the loop tries to skip the inter-packet delay on the final ping:
/* if the response time is more than NETDEV_PING_DELAY, no need to delay */delay_tick= ((rt_tick_get() -start_tick) >NETDEV_PING_DELAY) || (index==times) ? 0 : NETDEV_PING_DELAY;
rt_thread_delay(delay_tick);
Two issues:
The index == times condition is never true inside the loop (index < times), so the delay is still applied after the last packet, contrary to the comment.
When delay_tick becomes 0, rt_thread_delay(0) is still called and returns -RT_EINVAL (invalid argument).
Proposed fix: compute the actual elapsed time, skip the delay on the last packet via index != times - 1, and only call rt_thread_delay() when delay_tick > 0.
Activity
ymj0440 commentedon Oct 14, 2026
/claim
github-actions commentedon Oct 14, 2026
@ymj0440 has claimed this issue.
github-actions commentedon Oct 14, 2026
如需认领并处理此 Issue,请评论
/claim。To claim and work on this issue, comment
/claim.