Commit 74b9c004 authored by Gildas Bazin's avatar Gildas Bazin

* plugins/network/ipv6.c: attempt to fix the win32 implementation. Multicast should even
work (untested) although we'll need to find a way to replace if_nametoindex() to have a
fully functionnal win32 port.
parent 886080d9
......@@ -2,7 +2,7 @@
* ipv6.c: IPv6 network abstraction layer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: ipv6.c,v 1.8.2.2 2002/07/19 21:12:18 massiot Exp $
* $Id: ipv6.c,v 1.8.2.3 2002/07/29 16:15:49 gbazin Exp $
*
* Authors: Alexis Guillard <alexis.guillard@bt.com>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -57,6 +57,13 @@
#if defined(WIN32)
static const struct in6_addr in6addr_any = {{IN6ADDR_ANY_INIT}};
/* the following will have to be removed when w32api defines them */
#ifndef IPPROTO_IPV6
# define IPPROTO_IPV6 41
#endif
#ifndef IPV6_JOIN_GROUP
# define IPV6_JOIN_GROUP 20
#endif
#endif
/*****************************************************************************
......@@ -151,7 +158,13 @@ static int BuildAddr( struct sockaddr_in6 * p_socket,
intf_WarnMsg( 3, "Interface name specified: \"%s\"",
psz_multicast_interface );
/* now convert that interface name to an index */
#if !defined( WIN32 )
p_socket->sin6_scope_id = if_nametoindex(psz_multicast_interface);
#else
/* FIXME: for now we always use the default interface */
p_socket->sin6_scope_id = 0;
intf_WarnMsg( 3, "Using default interface. This has to be FIXED!");
#endif
intf_WarnMsg( 3, " = #%i\n", p_socket->sin6_scope_id );
}
psz_address[strlen(psz_address) - 1] = '\0' ;
......@@ -327,7 +340,7 @@ static int OpenUDP( network_socket_t * p_socket )
imr.ipv6mr_interface = sock.sin6_scope_id;
imr.ipv6mr_multiaddr = sock.sin6_addr;
res = setsockopt(i_handle, IPPROTO_IPV6, IPV6_JOIN_GROUP, &imr,
res = setsockopt(i_handle, IPPROTO_IPV6, IPV6_JOIN_GROUP, (void *)&imr,
sizeof(imr));
if( res == -1 )
......
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