#ifndef AI_NUMERICSERV
# define AI_NUMERICSERV 0
#endif
+#ifndef AI_IDN
+# define AI_IDN 0 /* GNU/libc extension */
+#endif
#ifdef __OS2__
# ifndef NI_NUMERICHOST
.ai_family = AF_UNSPEC,
.ai_socktype = SOCK_DGRAM,
.ai_protocol = 0,
- .ai_flags = AI_NUMERICHOST | AI_NUMERICSERV
+ .ai_flags = AI_NUMERICHOST | AI_NUMERICSERV | AI_IDN,
};
char *shost = var_GetNonEmptyString (p_access, "src-addr");
char *dhost = var_GetNonEmptyString (p_access, "dst-addr");
goto out;
hints.ai_flags &= ~AI_NUMERICHOST;
}
-#endif
-#ifdef AI_IDN
- /* Run-time I18n Domain Names support */
- hints.ai_flags |= AI_IDN;
- ret = getaddrinfo (node, servname, &hints, res);
- if (ret != EAI_BADFLAGS)
- goto out;
- /* IDN not available: disable and retry without it */
- hints.ai_flags &= ~AI_IDN;
#endif
ret = getaddrinfo (node, servname, &hints, res);
-#if defined(AI_IDN) || defined(WIN32)
+#if defined(WIN32)
out:
#endif
return ret;
struct addrinfo hints = {
.ai_socktype = type,
.ai_protocol = protocol,
- .ai_flags = AI_PASSIVE | AI_NUMERICSERV,
+ .ai_flags = AI_PASSIVE | AI_NUMERICSERV | AI_IDN,
}, *res;
msg_Dbg (p_this, "net: listening to %s port %d",
struct addrinfo hints = {
.ai_socktype = type,
.ai_protocol = proto,
- .ai_flags = AI_NUMERICSERV,
+ .ai_flags = AI_NUMERICSERV | AI_IDN,
}, *res;
int val = vlc_getaddrinfo (psz_realhost, i_realport, &hints, &res);
.ai_family = AF_INET,
.ai_socktype = SOCK_STREAM,
.ai_protocol = IPPROTO_TCP,
- .ai_flags = 0,
+ .ai_flags = AI_IDN,
};
struct addrinfo *res;
struct addrinfo hints = {
.ai_socktype = SOCK_DGRAM,
.ai_protocol = protocol,
- .ai_flags = AI_PASSIVE | AI_NUMERICSERV,
+ .ai_flags = AI_PASSIVE | AI_NUMERICSERV | AI_IDN,
}, *res;
if (host && !*host)
struct addrinfo hints = {
.ai_socktype = SOCK_DGRAM,
.ai_protocol = proto,
- .ai_flags = AI_NUMERICSERV,
+ .ai_flags = AI_NUMERICSERV | AI_IDN,
}, *res;
int i_handle = -1;
bool b_unreach = false;
struct addrinfo hints = {
.ai_socktype = SOCK_DGRAM,
.ai_protocol = protocol,
- .ai_flags = AI_NUMERICSERV,
+ .ai_flags = AI_NUMERICSERV | AI_IDN,
}, *loc, *rem;
int val = vlc_getaddrinfo (psz_server, i_server, &hints, &rem);