Commit 1d974c62 authored by Rémi Denis-Courmont's avatar 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.
parent 1616903a
......@@ -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 );
......
......@@ -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" );
......
......@@ -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>
......
......@@ -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' );
}
......
......@@ -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 )
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment