iputils/2583fb77dd57c5183998177a3fa13a680b573005.patch
2020-11-29 20:58:59 +08:00

35 lines
1.0 KiB
Diff

diff --git a/ping/ping.c b/ping/ping.c
index e277697..d96298e 100644
--- a/ping/ping.c
+++ b/ping/ping.c
@@ -1314,8 +1314,11 @@ int ping4_receive_error_msg(struct ping_rts *rts, socket_st *sock)
msg.msg_controllen = sizeof(cbuf);
res = recvmsg(sock->fd, &msg, MSG_ERRQUEUE | MSG_DONTWAIT);
- if (res < 0)
+ if (res < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ local_errors++;
goto out;
+ }
e = NULL;
for (cmsgh = CMSG_FIRSTHDR(&msg); cmsgh; cmsgh = CMSG_NXTHDR(&msg, cmsgh)) {
diff --git a/ping/ping6_common.c b/ping/ping6_common.c
index 279c533..459f63e 100644
--- a/ping/ping6_common.c
+++ b/ping/ping6_common.c
@@ -481,8 +481,11 @@ int ping6_receive_error_msg(struct ping_rts *rts, socket_st *sock)
msg.msg_controllen = sizeof(cbuf);
res = recvmsg(sock->fd, &msg, MSG_ERRQUEUE | MSG_DONTWAIT);
- if (res < 0)
+ if (res < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ local_errors++;
goto out;
+ }
e = NULL;
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {