update code

This commit is contained in:
Nick Peng
2018-10-23 23:14:26 +08:00
parent 0d42cd0241
commit 697879ff5d

View File

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