Commit b4011103 authored by Gildas Bazin's avatar Gildas Bazin

* modules/misc/network/ipv6.c: oups, ipv6 multicast wasn't enabled on win32. Also fixed the interface name parsing in the MRL.
parent db64ee87
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ipv6.c: IPv6 network abstraction layer * ipv6.c: IPv6 network abstraction layer
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: ipv6.c,v 1.9 2003/04/21 16:22:43 gbazin Exp $ * $Id: ipv6.c,v 1.10 2003/06/06 11:09:24 gbazin Exp $
* *
* Authors: Alexis Guillard <alexis.guillard@bt.com> * Authors: Alexis Guillard <alexis.guillard@bt.com>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -132,7 +132,9 @@ static int BuildAddr( vlc_object_t * p_this, struct sockaddr_in6 * p_socket, ...@@ -132,7 +132,9 @@ static int BuildAddr( vlc_object_t * p_this, struct sockaddr_in6 * p_socket,
else if( psz_address[0] == '[' else if( psz_address[0] == '['
&& psz_address[strlen(psz_address) - 1] == ']' ) && psz_address[strlen(psz_address) - 1] == ']' )
{ {
psz_address[strlen(psz_address) - 1] = '\0';
psz_address++; psz_address++;
/* see if there is an interface name in there... */ /* see if there is an interface name in there... */
if( (psz_multicast_interface = strchr(psz_address, '%')) != NULL ) if( (psz_multicast_interface = strchr(psz_address, '%')) != NULL )
{ {
...@@ -142,17 +144,14 @@ static int BuildAddr( vlc_object_t * p_this, struct sockaddr_in6 * p_socket, ...@@ -142,17 +144,14 @@ static int BuildAddr( vlc_object_t * p_this, struct sockaddr_in6 * p_socket,
psz_multicast_interface ); psz_multicast_interface );
/* now convert that interface name to an index */ /* now convert that interface name to an index */
#if __GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
# if !defined( WIN32 )
p_socket->sin6_scope_id = if_nametoindex(psz_multicast_interface); p_socket->sin6_scope_id = if_nametoindex(psz_multicast_interface);
# else #elif defined( WIN32 )
/* FIXME: for now we always use the default interface */ /* FIXME ?? */
p_socket->sin6_scope_id = 0; p_socket->sin6_scope_id = atol(psz_multicast_interface);
# endif
msg_Warn( p_this, " = #%i", p_socket->sin6_scope_id );
#endif #endif
msg_Dbg( p_this, " = #%i", p_socket->sin6_scope_id );
} }
psz_address[strlen(psz_address) - 1] = '\0' ;
#if !defined( WIN32 ) #if !defined( WIN32 )
inet_pton(AF_INET6, psz_address, &p_socket->sin6_addr.s6_addr); inet_pton(AF_INET6, psz_address, &p_socket->sin6_addr.s6_addr);
...@@ -318,7 +317,7 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket ) ...@@ -318,7 +317,7 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket )
} }
/* Join the multicast group if the socket is a multicast address */ /* Join the multicast group if the socket is a multicast address */
#if __GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2 #if defined(WIN32) || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
if( IN6_IS_ADDR_MULTICAST(&sock.sin6_addr) ) if( IN6_IS_ADDR_MULTICAST(&sock.sin6_addr) )
{ {
struct ipv6_mreq imr; struct ipv6_mreq imr;
......
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