[components] [lwip]重新提交 : ping超时计算bug (#7545)

函数的输入超时参数的单位是ms, 系统接口无论1.x版本还是2.x, 最终都会将毫秒时间再去转一次tick, 用于rtthread邮件接收超时. 所以此处直接按原值进行转换,不需要加入对RT_TICK_PER_SECOND的转换
This commit is contained in:
Yohozzy 2023-05-29 14:02:01 +08:00 committed by GitHub
parent 6d0f2267e8
commit 0cbb665a1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,9 +208,9 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len,
int elapsed_time;
rt_tick_t recv_start_tick;
#if LWIP_VERSION_MAJOR == 1U /* v1.x */
int recv_timeout = timeout * 1000UL / RT_TICK_PER_SECOND;
int recv_timeout = timeout;
#else /* >= v2.x */
struct timeval recv_timeout = { timeout / RT_TICK_PER_SECOND, timeout % RT_TICK_PER_SECOND };
struct timeval recv_timeout = { timeout / 1000UL, timeout % 1000UL * 1000 };
#endif
ip_addr_t target_addr;
struct addrinfo hint, *res = RT_NULL;