[vlc-commits] commit: getaddrinfo() may list IPv6 even if not supported ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Sun Mar 28 19:45:57 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Mar 28 20:40:45 2010 +0300| [0707e3ff6d315e5a6c22e0b994542f5dff248561] | committer: Rémi Denis-Courmont 

getaddrinfo() may list IPv6 even if not supported

This fixes the RTP input failing completely.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0707e3ff6d315e5a6c22e0b994542f5dff248561
---

 src/network/udp.c |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/network/udp.c b/src/network/udp.c
index 4d8ac2e..ab1792e 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 )



More information about the vlc-commits mailing list