[ping] fix ping early return when ping is interrupted by ifdown and poll return
During a long ping, the tester will repeatedly switch the dev interface on and off. When the interface is down and ping is in poll sem_wait state,ifdown will trigger event of poll and post sem. The poll will return and revent is 0x18 POLLHUP | POLLERR.Then recvfrom will process and return error to stop ping. if ((flags & NETDEV_DOWN) != 0) { eventset |= (POLLHUP | POLLERR); } Signed-off-by: meijian <meijian@xiaomi.com>
This commit is contained in:
parent
ad7f69d25e
commit
c0c9a6007c
@ -307,6 +307,12 @@ void icmp_ping(FAR const struct ping_info_s *info)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (priv->recvfd.revents & (POLLHUP | POLLERR))
|
||||
{
|
||||
icmp_callback(&result, ICMP_E_POLL, ENETDOWN);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Get the ICMP response (ignoring the sender) */
|
||||
|
||||
priv->addrlen = sizeof(struct sockaddr_in);
|
||||
|
Loading…
Reference in New Issue
Block a user