]> git.sesse.net Git - vlc/commitdiff
getaddrinfo() may list IPv6 even if not supported
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 28 Mar 2010 17:40:45 +0000 (20:40 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 28 Mar 2010 17:41:43 +0000 (20:41 +0300)
This fixes the RTP input failing completely.

src/network/udp.c

index 4d8ac2ebdc659e302b06ebab0e434585070a56d1..ab1792e6de2a2587fd4b45cc3a2da4dd92050be0 100644 (file)
@@ -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 )