[Pkg-voip-commits] [bctoolbox] 33/60: Fix abusive error traces when checking for ipv6 connectivity on macosx

Bernhard Schmidt berni at moszumanska.debian.org
Sun Oct 15 22:42:25 UTC 2017


This is an automated email from the git hooks/post-receive script.

berni pushed a commit to branch debian/sid
in repository bctoolbox.

commit 44ee926f88c22c1d82ee1c305c27c17c565f9632
Author: Jehan Monnier <jehan.monnier at linphone.org>
Date:   Wed Apr 19 17:44:55 2017 +0200

    Fix abusive error traces when checking for ipv6 connectivity on macosx
---
 include/bctoolbox/port.h | 11 ++++++-----
 src/utils/port.c         |  5 ++++-
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/include/bctoolbox/port.h b/include/bctoolbox/port.h
index 43bf9bc..e1c1c91 100644
--- a/include/bctoolbox/port.h
+++ b/include/bctoolbox/port.h
@@ -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"
diff --git a/src/utils/port.c b/src/utils/port.c
index 0abe9d3..070f486 100644
--- a/src/utils/port.c
+++ b/src/utils/port.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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/bctoolbox.git



More information about the Pkg-voip-commits mailing list