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; }