summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--components/net/lwip/port/ethernetif.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/net/lwip/port/ethernetif.c b/components/net/lwip/port/ethernetif.c
index fa2ed36edd..85d8dba0cb 100644
--- a/components/net/lwip/port/ethernetif.c
+++ b/components/net/lwip/port/ethernetif.c
@@ -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;