diff --git a/src/mpl/src/sock/mpl_sockaddr.c b/src/mpl/src/sock/mpl_sockaddr.c index bbced06..e36499b 100644 --- a/src/mpl/src/sock/mpl_sockaddr.c +++ b/src/mpl/src/sock/mpl_sockaddr.c @@ -75,6 +75,7 @@ int MPL_get_sockaddr(const char *s_hostname, MPL_sockaddr_t * p_addr) struct addrinfo *ai_list; int ret; +#ifdef __APPLE__ /* Macos adds .local to hostname when network is unavailable or limited. * This will result in long timeout in getaddrinfo below. * Bypass it by resetting the hostname to "localhost" @@ -83,6 +84,7 @@ int MPL_get_sockaddr(const char *s_hostname, MPL_sockaddr_t * p_addr) if (n > 6 && strcmp(s_hostname + n - 6, ".local") == 0) { s_hostname = "localhost"; } +#endif /* NOTE: there is report that getaddrinfo implementations will call kernel * even when s_hostname is entirely numerical string and it may cause