From 697879ff5dbc89227b0232e2d910ab23d4c578fb Mon Sep 17 00:00:00 2001 From: Nick Peng Date: Tue, 23 Oct 2018 23:14:26 +0800 Subject: [PATCH] update code --- src/fast_ping.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fast_ping.c b/src/fast_ping.c index 559b920..2bd1437 100644 --- a/src/fast_ping.c +++ b/src/fast_ping.c @@ -323,7 +323,7 @@ static int _fast_ping_sendping_v6(struct ping_host_struct *ping_host) len = sendto(ping.fd_icmp6, &ping_host->packet, sizeof(struct fast_ping_packet), 0, (struct sockaddr *)&ping_host->addr, ping_host->addr_len); if (len < 0 || len != sizeof(struct fast_ping_packet)) { int err = errno; - if (errno == ENETUNREACH) { + if (errno == ENETUNREACH || errno == EINVAL) { goto errout; } @@ -369,7 +369,7 @@ static int _fast_ping_sendping_v4(struct ping_host_struct *ping_host) len = sendto(ping.fd_icmp, packet, sizeof(struct fast_ping_packet), 0, (struct sockaddr *)&ping_host->addr, ping_host->addr_len); if (len < 0 || len != sizeof(struct fast_ping_packet)) { int err = errno; - if (errno == ENETUNREACH) { + if (errno == ENETUNREACH || errno == EINVAL) { goto errout; } char ping_host_name[PING_MAX_HOSTLEN]; @@ -404,7 +404,7 @@ static int _fast_ping_sendping_tcp(struct ping_host_struct *ping_host) if (connect(fd, (struct sockaddr *)&ping_host->addr, ping_host->addr_len) != 0) { if (errno != EINPROGRESS) { char ping_host_name[PING_MAX_HOSTLEN]; - if (errno == ENETUNREACH) { + if (errno == ENETUNREACH || errno == EINVAL) { goto errout; }