log: optimize log

This commit is contained in:
Nick Peng
2022-12-30 21:13:50 +08:00
parent dd9cf62d10
commit 69ab9585d7
2 changed files with 28 additions and 5 deletions

View File

@@ -521,7 +521,7 @@ static int _fast_ping_sendping_v6(struct ping_host_struct *ping_host)
ping_host->addr_len);
if (len < 0 || len != sizeof(struct fast_ping_packet)) {
int err = errno;
if (errno == ENETUNREACH || errno == EINVAL || errno == EADDRNOTAVAIL) {
if (errno == ENETUNREACH || errno == EINVAL || errno == EADDRNOTAVAIL || errno == EHOSTUNREACH) {
goto errout;
}
@@ -668,7 +668,7 @@ static int _fast_ping_sendping_tcp(struct ping_host_struct *ping_host)
if (connect(fd, &ping_host->addr, ping_host->addr_len) != 0) {
if (errno != EINPROGRESS) {
char ping_host_name[PING_MAX_HOSTLEN];
if (errno == ENETUNREACH || errno == EINVAL || errno == EADDRNOTAVAIL) {
if (errno == ENETUNREACH || errno == EINVAL || errno == EADDRNOTAVAIL || errno == EHOSTUNREACH) {
goto errout;
}