[vlc-commits] Nuke manual IP version selection

Rémi Denis-Courmont git at videolan.org
Sat Jun 11 21:30:35 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jun 11 22:12:16 2011 +0300| [1d974c62db48ef87d5e79e0fe70ead247baf19af] | committer: Rémi Denis-Courmont

Nuke manual IP version selection

World IPv6 day was a non-event, establishing that those options are
useless, and so should they.

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

 modules/access/mms/mms.c         |    4 --
 modules/services_discovery/sap.c |   58 ++++++++++++++-----------------------
 share/lua/http/dialogs/input     |    2 -
 share/lua/http/js/functions.js   |    2 -
 src/libvlc-module.c              |   14 +--------
 src/network/getaddrinfo.c        |   11 -------
 6 files changed, 24 insertions(+), 67 deletions(-)

diff --git a/modules/access/mms/mms.c b/modules/access/mms/mms.c
index 7d9fb20..2a8bcce 100644
--- a/modules/access/mms/mms.c
+++ b/modules/access/mms/mms.c
@@ -107,10 +107,6 @@ static int Open( vlc_object_t *p_this )
 {
     access_t *p_access = (access_t*)p_this;
 
-    /* First set ipv4/ipv6 */
-    var_Create( p_access, "ipv4", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
-    var_Create( p_access, "ipv6", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
-
     /* mms-caching */
     var_Create( p_access, "mms-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
 
diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c
index 18e841a..2a52995 100644
--- a/modules/services_discovery/sap.c
+++ b/modules/services_discovery/sap.c
@@ -80,12 +80,6 @@
 #define SAP_ADDR_LONGTEXT N_( "The SAP module normally chooses itself the " \
                               "right addresses to listen to. However, you " \
                               "can specify a specific address." )
-#define SAP_IPV4_TEXT N_( "IPv4 SAP" )
-#define SAP_IPV4_LONGTEXT N_( \
-      "Listen to IPv4 announcements on the standard addresses." )
-#define SAP_IPV6_TEXT N_( "IPv6 SAP" )
-#define SAP_IPV6_LONGTEXT N_( \
-      "Listen to IPv6 announcements on the standard addresses." )
 #define SAP_SCOPE_TEXT N_( "IPv6 SAP scope" )
 #define SAP_SCOPE_LONGTEXT N_( \
        "Scope for IPv6 announcements (default is 8)." )
@@ -124,10 +118,8 @@ vlc_module_begin ()
 
     add_string( "sap-addr", NULL,
                 SAP_ADDR_TEXT, SAP_ADDR_LONGTEXT, true )
-    add_bool( "sap-ipv4", true,
-               SAP_IPV4_TEXT,SAP_IPV4_LONGTEXT, true )
-    add_bool( "sap-ipv6", true,
-              SAP_IPV6_TEXT, SAP_IPV6_LONGTEXT, true )
+    add_obsolete_bool( "sap-ipv4" ) /* since 1.2.0 */
+    add_obsolete_bool( "sap-ipv6" ) /* since 1.2.0 */
     add_integer( "sap-timeout", 1800,
                  SAP_TIMEOUT_TEXT, SAP_TIMEOUT_LONGTEXT, true )
     add_bool( "sap-parse", true,
@@ -495,29 +487,24 @@ static void *Run( void *data )
      * Winsock 1.1 from Windows 95, if not Windows 3.1.
      * Anyway, to avoid a 30 seconds delay for failed IPv6 socket creation,
      * we have to open sockets in Run() rather than Open(). */
-    if( var_CreateGetBool( p_sd, "sap-ipv4" ) )
-    {
-        InitSocket( p_sd, SAP_V4_GLOBAL_ADDRESS, SAP_PORT );
-        InitSocket( p_sd, SAP_V4_ORG_ADDRESS, SAP_PORT );
-        InitSocket( p_sd, SAP_V4_LOCAL_ADDRESS, SAP_PORT );
-        InitSocket( p_sd, SAP_V4_LINK_ADDRESS, SAP_PORT );
-    }
-    if( var_CreateGetBool( p_sd, "sap-ipv6" ) )
-    {
-        char psz_address[NI_MAXNUMERICHOST] = "ff02::2:7ffe%";
+    InitSocket( p_sd, SAP_V4_GLOBAL_ADDRESS, SAP_PORT );
+    InitSocket( p_sd, SAP_V4_ORG_ADDRESS, SAP_PORT );
+    InitSocket( p_sd, SAP_V4_LOCAL_ADDRESS, SAP_PORT );
+    InitSocket( p_sd, SAP_V4_LINK_ADDRESS, SAP_PORT );
 
+    char psz_address[NI_MAXNUMERICHOST] = "ff02::2:7ffe%";
 #ifndef WIN32
-        struct if_nameindex *l = if_nameindex ();
-        if (l != NULL)
+    struct if_nameindex *l = if_nameindex ();
+    if (l != NULL)
+    {
+        char *ptr = strchr (psz_address, '%') + 1;
+        for (unsigned i = 0; l[i].if_index; i++)
         {
-            char *ptr = strchr (psz_address, '%') + 1;
-            for (unsigned i = 0; l[i].if_index; i++)
-            {
-                strcpy (ptr, l[i].if_name);
-                InitSocket (p_sd, psz_address, SAP_PORT);
-            }
-            if_freenameindex (l);
+            strcpy (ptr, l[i].if_name);
+            InitSocket (p_sd, psz_address, SAP_PORT);
         }
+        if_freenameindex (l);
+    }
 #else
         /* this is the Winsock2 equivalant of SIOCGIFCONF on BSD stacks,
            which if_nameindex uses internally anyway */
@@ -542,14 +529,13 @@ static void *Run( void *data )
             closesocket(s);
         }
 #endif
-        *strchr (psz_address, '%') = '\0';
+    *strchr (psz_address, '%') = '\0';
 
-        static const char ipv6_scopes[] = "1456789ABCDE";
-        for (const char *c_scope = ipv6_scopes; *c_scope; c_scope++)
-        {
-            psz_address[3] = *c_scope;
-            InitSocket( p_sd, psz_address, SAP_PORT );
-        }
+    static const char ipv6_scopes[] = "1456789ABCDE";
+    for (const char *c_scope = ipv6_scopes; *c_scope; c_scope++)
+    {
+        psz_address[3] = *c_scope;
+        InitSocket( p_sd, psz_address, SAP_PORT );
     }
 
     psz_addr = var_CreateGetString( p_sd, "sap-addr" );
diff --git a/share/lua/http/dialogs/input b/share/lua/http/dialogs/input
index dbcfec9..fd58d70 100644
--- a/share/lua/http/dialogs/input
+++ b/share/lua/http/dialogs/input
@@ -170,8 +170,6 @@ This dialog needs the following dialogs to be fully functional: browse
           <td>
             <label for="input_net_udp_port">Port</label>
             <input type="text" id="input_net_udp_port" size="6" onchange="update_input_net();" />
-            <input type="checkbox" id="input_net_udp_forceipv6" onchange="update_input_net();" />
-            <label for="input_net_udp_forceipv6">Force IPv6</label>
           </td>
         </tr>
         <tr>
diff --git a/share/lua/http/js/functions.js b/share/lua/http/js/functions.js
index d751716..9c3f07d 100644
--- a/share/lua/http/js/functions.js
+++ b/share/lua/http/js/functions.js
@@ -806,8 +806,6 @@ function update_input_net()
     if( type == "udp" )
     {
         mrl.value += "udp://";
-        if( checked( 'input_net_udp_forceipv6' ) )
-            mrl.value += "[::]";
         if( value( 'input_net_udp_port' ) )
             mrl.value += ":"+value( 'input_net_udp_port' );
     }
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 7ea88ba..07cd09b 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -887,14 +887,6 @@ static const char *const ppsz_clock_descriptions[] =
 #define VCD_DEVICE       CD_DEVICE
 #define CDAUDIO_DEVICE   CD_DEVICE
 
-#define IPV6_TEXT N_("Force IPv6")
-#define IPV6_LONGTEXT N_( \
-    "IPv6 will be used by default for all connections.")
-
-#define IPV4_TEXT N_("Force IPv4")
-#define IPV4_LONGTEXT N_( \
-    "IPv4 will be used by default for all connections.")
-
 #define TIMEOUT_TEXT N_("TCP connection timeout")
 #define TIMEOUT_LONGTEXT N_( \
     "Default TCP connection timeout (in milliseconds). " )
@@ -1884,10 +1876,8 @@ vlc_module_begin ()
     add_integer( "server-port", 1234,
                  SERVER_PORT_TEXT, SERVER_PORT_LONGTEXT, false )
     add_integer( "mtu", MTU_DEFAULT, MTU_TEXT, MTU_LONGTEXT, true )
-    add_bool( "ipv6", 0, IPV6_TEXT, IPV6_LONGTEXT, false )
-        change_short('6')
-    add_bool( "ipv4", 0, IPV4_TEXT, IPV4_LONGTEXT, false )
-        change_short('4')
+    add_obsolete_bool( "ipv6" ) /* since 1.2.0 */
+    add_obsolete_bool( "ipv4" ) /* since 1.2.0 */
     add_integer( "ipv4-timeout", 5 * 1000, TIMEOUT_TEXT,
                  TIMEOUT_LONGTEXT, true )
 
diff --git a/src/network/getaddrinfo.c b/src/network/getaddrinfo.c
index f63b64a..6648f88 100644
--- a/src/network/getaddrinfo.c
+++ b/src/network/getaddrinfo.c
@@ -134,17 +134,6 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node,
     /* We only ever use port *numbers* */
     hints.ai_flags |= AI_NUMERICSERV;
 
-    if( hints.ai_family == AF_UNSPEC )
-    {
-#ifdef AF_INET6
-        if (var_InheritBool (p_this, "ipv6"))
-            hints.ai_family = AF_INET6;
-        else
-#endif
-        if (var_InheritBool (p_this, "ipv4"))
-            hints.ai_family = AF_INET;
-    }
-
     /*
      * VLC extensions :
      * - accept "" as NULL



More information about the vlc-commits mailing list