Use AI_PASSIVE for bind address only, not for connect address
authorRémi Denis-Courmont <rem@videolan.org>
Sat, 18 Aug 2007 17:37:16 +0000 (17:37 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sat, 18 Aug 2007 17:37:16 +0000 (17:37 +0000)
src/network/udp.c

index 4e436da..fe486af 100644 (file)
@@ -710,7 +710,6 @@ int __net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind,
     memset (&hints, 0, sizeof (hints));
     hints.ai_family = family;
     hints.ai_socktype = SOCK_DGRAM;
     memset (&hints, 0, sizeof (hints));
     hints.ai_family = family;
     hints.ai_socktype = SOCK_DGRAM;
-    hints.ai_flags = AI_PASSIVE;
 
     val = vlc_getaddrinfo (obj, psz_server, i_server, &hints, &rem);
     if (val)
 
     val = vlc_getaddrinfo (obj, psz_server, i_server, &hints, &rem);
     if (val)
@@ -720,6 +719,7 @@ int __net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind,
         return -1;
     }
 
         return -1;
     }
 
+    hints.ai_flags = AI_PASSIVE;
     val = vlc_getaddrinfo (obj, psz_bind, i_bind, &hints, &loc);
     if (val)
     {
     val = vlc_getaddrinfo (obj, psz_bind, i_bind, &hints, &loc);
     if (val)
     {