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

- Always use AI_NUMERICSERV since we cannot use service names in LibVLC

- Only pass used ai_flags so we won't break if broken IETF draft
  draft-chakrabarti-ipv6-addrselect-api-05 makes it to standard
parent 61146841
...@@ -589,10 +589,16 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node, ...@@ -589,10 +589,16 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
snprintf( psz_service, 6, "%d", i_port ); snprintf( psz_service, 6, "%d", i_port );
/* Check if we have to force ipv4 or ipv6 */ /* Check if we have to force ipv4 or ipv6 */
if( p_hints == NULL ) memset (&hints, 0, sizeof (hints));
memset( &hints, 0, sizeof( hints ) ); if (p_hints != NULL)
else {
memcpy( &hints, p_hints, sizeof( hints ) ); hints.ai_family = p_hints->ai_family;
hints.ai_socktype = p_hints->ai_socktype;
hints.ai_protocol = p_hints->ai_protocol;
hints.ai_flags = p_hints->ai_flags & (AI_NUMERICHOST|AI_PASSIVE);
}
/* we only ever use port *numbers* */
hints.ai_flags |= AI_NUMERICSERV;
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