Commit ce872c2f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

- Also allow AI_CANNONAME in case someone ever uses it

- Fix MacOS X WTF: standard AI_NUMERICSERV is missing
- Avoid defining _*I_MASK if not needed
parent 1ec75fc5
...@@ -54,10 +54,6 @@ ...@@ -54,10 +54,6 @@
# define AF_UNSPEC 0 # define AF_UNSPEC 0
#endif #endif
#define _NI_MASK (NI_NUMERICHOST|NI_NUMERICSERV|NI_NOFQDN|NI_NAMEREQD|\
NI_DGRAM)
#define _AI_MASK (AI_PASSIVE|AI_CANONNAME|AI_NUMERICHOST)
#ifndef HAVE_GAI_STRERROR #ifndef HAVE_GAI_STRERROR
static struct static struct
...@@ -103,6 +99,8 @@ const char *vlc_gai_strerror (int errnum) ...@@ -103,6 +99,8 @@ const char *vlc_gai_strerror (int errnum)
#endif #endif
#ifndef HAVE_GETNAMEINFO #ifndef HAVE_GETNAMEINFO
#define _NI_MASK (NI_NUMERICHOST|NI_NUMERICSERV|NI_NOFQDN|NI_NAMEREQD|\
NI_DGRAM)
/* /*
* getnameinfo() non-thread-safe IPv4-only implementation, * getnameinfo() non-thread-safe IPv4-only implementation,
* Address-family-independant address to hostname translation * Address-family-independant address to hostname translation
...@@ -161,6 +159,7 @@ getnameinfo (const struct sockaddr *sa, socklen_t salen, ...@@ -161,6 +159,7 @@ getnameinfo (const struct sockaddr *sa, socklen_t salen,
#endif /* if !HAVE_GETNAMEINFO */ #endif /* if !HAVE_GETNAMEINFO */
#ifndef HAVE_GETADDRINFO #ifndef HAVE_GETADDRINFO
#define _AI_MASK (AI_PASSIVE|AI_CANONNAME|AI_NUMERICHOST)
/* /*
* Converts the current herrno error value into an EAI_* error code. * Converts the current herrno error value into an EAI_* error code.
* That error code is normally returned by getnameinfo() or getaddrinfo(). * That error code is normally returned by getnameinfo() or getaddrinfo().
...@@ -595,10 +594,12 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node, ...@@ -595,10 +594,12 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
hints.ai_family = p_hints->ai_family; hints.ai_family = p_hints->ai_family;
hints.ai_socktype = p_hints->ai_socktype; hints.ai_socktype = p_hints->ai_socktype;
hints.ai_protocol = p_hints->ai_protocol; hints.ai_protocol = p_hints->ai_protocol;
hints.ai_flags = p_hints->ai_flags & (AI_NUMERICHOST|AI_PASSIVE); hints.ai_flags = p_hints->ai_flags & (AI_NUMERICHOST|AI_PASSIVE|AI_CANONNAME);
} }
#ifdef AI_NUMERICSERV
/* we only ever use port *numbers* */ /* we only ever use port *numbers* */
hints.ai_flags |= AI_NUMERICSERV; hints.ai_flags |= AI_NUMERICSERV;
#endif
if( hints.ai_family == AF_UNSPEC ) if( hints.ai_family == AF_UNSPEC )
{ {
......
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