Commit 44ee926f authored by jehan's avatar jehan

Fix abusive error traces when checking for ipv6 connectivity on macosx

parent 866a216e
......@@ -77,11 +77,12 @@ typedef pthread_cond_t bctbx_cond_t;
#define BCTBX_PUBLIC
#define BCTBX_INLINE inline
#define BCTBX_EWOULDBLOCK EWOULDBLOCK
#define BCTBX_EINPROGRESS EINPROGRESS
#define BCTBX_ENETUNREACH ENETUNREACH
#define BCTBX_EHOSTUNREACH EHOSTUNREACH
#define BCTBX_ENOTCONN ENOTCONN
#define BCTBX_EWOULDBLOCK EWOULDBLOCK
#define BCTBX_EINPROGRESS EINPROGRESS
#define BCTBX_ENETUNREACH ENETUNREACH
#define BCTBX_EHOSTUNREACH EHOSTUNREACH
#define BCTBX_ENOTCONN ENOTCONN
#define BCTBX_EPROTOTYPE EPROTOTYPE /* Protocol wrong type for socket */
#ifdef __cplusplus
extern "C"
......
......@@ -1486,7 +1486,10 @@ static int get_local_ip_for_with_connect(int type, const char *dest, int port, c
err = connect(sock, res->ai_addr, (int)res->ai_addrlen);
if (err == -1) {
/* The network isn't reachable. We don't display the error as it is the case that we want to check in normal operation. */
if (getSocketErrorCode() != BCTBX_ENETUNREACH || getSocketErrorCode() != BCTBX_EHOSTUNREACH) bctbx_error("Error in connect: %s", getSocketError());
if ( getSocketErrorCode() != BCTBX_ENETUNREACH
&& getSocketErrorCode() != BCTBX_EHOSTUNREACH
&& getSocketErrorCode() != BCTBX_EPROTOTYPE)
bctbx_error("Error in connect: %s", getSocketError());
freeaddrinfo(res);
bctbx_socket_close(sock);
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment