]> git.sesse.net Git - vlc/commitdiff
Upnp: Fix #6250, honor --miface.
authorKonstantin Pavlov <thresh@videolan.org>
Wed, 23 May 2012 17:54:27 +0000 (21:54 +0400)
committerKonstantin Pavlov <thresh@videolan.org>
Thu, 24 May 2012 06:03:49 +0000 (10:03 +0400)
modules/services_discovery/upnp.cpp

index 96b8880ac849c44c2d93fb5c23bd8528adbabd49..bb81e03d1fc8966703407a2e7511b787569440ae 100644 (file)
@@ -110,10 +110,16 @@ static int Open( vlc_object_t *p_this )
     if( !( p_sd->p_sys = p_sys ) )
         return VLC_ENOMEM;
 
-    /* Initialize on first IPv4-capable adapter and first open port
-     * TODO: use UpnpInit2() to utilize IPv6.
-     */
+#ifdef UPNP_ENABLE_IPV6
+    char* psz_miface;
+    psz_miface = var_InheritString( p_sd, "miface" );
+    msg_Info( p_sd, "Initializing libupnp on '%s' interface", psz_miface );
+    i_res = UpnpInit2( psz_miface, 0 );
+    free( psz_miface );
+#else
+    /* If UpnpInit2 isnt available, initialize on first IPv4-capable interface */
     i_res = UpnpInit( 0, 0 );
+#endif
     if( i_res != UPNP_E_SUCCESS )
     {
         msg_Err( p_sd, "Initialization failed: %s", UpnpGetErrorMessage( i_res ) );