From: RĂ©mi Denis-Courmont Date: Sun, 28 Mar 2010 17:40:45 +0000 (+0300) Subject: getaddrinfo() may list IPv6 even if not supported X-Git-Tag: 1.1.0-pre1~277 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=0707e3ff6d315e5a6c22e0b994542f5dff248561;hp=c175d9308b5be3a12e1c32a8838fee043438ab98;p=vlc getaddrinfo() may list IPv6 even if not supported This fixes the RTP input failing completely. --- diff --git a/src/network/udp.c b/src/network/udp.c index 4d8ac2ebdc..ab1792e6de 100644 --- a/src/network/udp.c +++ b/src/network/udp.c @@ -180,25 +180,13 @@ static int net_ListenSingle (vlc_object_t *obj, const char *host, int port, int on = (family == AF_INET6); setsockopt (fd, SOL_IPV6, IPV6_V6ONLY, &on, sizeof (on)); } - else if (ptr->ai_family == AF_INET && family == AF_UNSPEC) - { - for (const struct addrinfo *p = ptr; p != NULL; p = p->ai_next) - if (p->ai_family == AF_INET6) - { - net_Close (fd); - fd = -1; - break; - } - if (fd == -1) - continue; - } -#else + if (ptr->ai_family == AF_INET) +#endif if (family == AF_UNSPEC && ptr->ai_next != NULL) { msg_Warn (obj, "ambiguous network protocol specification"); msg_Warn (obj, "please select IP version explicitly"); } -#endif fd = net_SetupDgramSocket( obj, fd, ptr ); if( fd == -1 )