From 0707e3ff6d315e5a6c22e0b994542f5dff248561 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 28 Mar 2010 20:40:45 +0300 Subject: [PATCH] getaddrinfo() may list IPv6 even if not supported This fixes the RTP input failing completely. --- src/network/udp.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) 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 ) -- 2.39.5