[vlc-commits] Upnp: Fix #6250, honor --miface.

Konstantin Pavlov git at videolan.org
Wed Jun 6 23:31:31 CEST 2012


vlc/vlc-2.0 | branch: master | Konstantin Pavlov <thresh at videolan.org> | Wed May 23 21:54:27 2012 +0400| [f4a44d365e26838988ab87cadea0aa4a775cdc0c] | committer: Jean-Baptiste Kempf

Upnp: Fix #6250, honor --miface.
(cherry picked from commit 683ff74a9050c948b593490728cf400fcb10334c)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/services_discovery/upnp.cpp |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index 4795486..8428480 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -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 ) );



More information about the vlc-commits mailing list