[Pkg-voip-commits] [bctoolbox] 10/57: Handle EHOSTUNREACH, used by iOS when IPv6 network is not available.
daniel at gnoutcheff.name
daniel at gnoutcheff.name
Thu Mar 30 04:31:31 UTC 2017
This is an automated email from the git hooks/post-receive script.
gnoutchd-guest pushed a commit to branch debian/sid
in repository bctoolbox.
commit 7f951f6d3d25b328de9fb006fbdc43a1463ad8ea
Author: Simon Morlat <simon.morlat at linphone.org>
Date: Thu Nov 17 22:19:08 2016 +0100
Handle EHOSTUNREACH, used by iOS when IPv6 network is not available.
---
include/bctoolbox/port.h | 14 ++++++++------
src/utils/port.c | 4 ++--
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/include/bctoolbox/port.h b/include/bctoolbox/port.h
index 907657b..102ab2f 100644
--- a/include/bctoolbox/port.h
+++ b/include/bctoolbox/port.h
@@ -73,9 +73,10 @@ 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_EWOULDBLOCK EWOULDBLOCK
+#define BCTBX_EINPROGRESS EINPROGRESS
+#define BCTBX_ENETUNREACH ENETUNREACH
+#define BCTBX_EHOSTUNREACH EHOSTUNREACH
#ifdef __cplusplus
extern "C"
@@ -231,9 +232,10 @@ BCTBX_PUBLIC int __bctbx_WIN_inet_aton (const char * cp, struct in_addr * addr);
#define SOCKET_OPTION_VALUE char *
#define BCTBX_INLINE __inline
-#define BCTBX_EWOULDBLOCK WSAEWOULDBLOCK
-#define BCTBX_EINPROGRESS WSAEINPROGRESS
-#define BCTBX_ENETUNREACH WSAENETUNREACH
+#define BCTBX_EWOULDBLOCK WSAEWOULDBLOCK
+#define BCTBX_EINPROGRESS WSAEINPROGRESS
+#define BCTBX_ENETUNREACH WSAENETUNREACH
+#define BCTBX_EHOSTUNREACH WSAEHOSTUNREACH
#if defined(_WIN32_WCE)
diff --git a/src/utils/port.c b/src/utils/port.c
index cb3e805..0c14438 100644
--- a/src/utils/port.c
+++ b/src/utils/port.c
@@ -1353,8 +1353,8 @@ static int get_local_ip_for_with_connect(int type, const char *dest, int port, c
if (err == -1) bctbx_warning("Error in setsockopt: %s", strerror(errno));
err = connect(sock, res->ai_addr, (int)res->ai_addrlen);
if (err == -1) {
- /* The network isn't reachable */
- if (getSocketErrorCode() != BCTBX_ENETUNREACH) bctbx_error("Error in connect: %s", strerror(errno));
+ /* 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", strerror(errno));
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