update code
This commit is contained in:
@@ -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);
|
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)) {
|
if (len < 0 || len != sizeof(struct fast_ping_packet)) {
|
||||||
int err = errno;
|
int err = errno;
|
||||||
if (errno == ENETUNREACH) {
|
if (errno == ENETUNREACH || errno == EINVAL) {
|
||||||
goto errout;
|
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);
|
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)) {
|
if (len < 0 || len != sizeof(struct fast_ping_packet)) {
|
||||||
int err = errno;
|
int err = errno;
|
||||||
if (errno == ENETUNREACH) {
|
if (errno == ENETUNREACH || errno == EINVAL) {
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
char ping_host_name[PING_MAX_HOSTLEN];
|
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 (connect(fd, (struct sockaddr *)&ping_host->addr, ping_host->addr_len) != 0) {
|
||||||
if (errno != EINPROGRESS) {
|
if (errno != EINPROGRESS) {
|
||||||
char ping_host_name[PING_MAX_HOSTLEN];
|
char ping_host_name[PING_MAX_HOSTLEN];
|
||||||
if (errno == ENETUNREACH) {
|
if (errno == ENETUNREACH || errno == EINVAL) {
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user