Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
4b00d01a
Commit
4b00d01a
authored
Jul 04, 2005
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPv6 Source-Specific Multicast support
from Hoerdt Mickael with cosmetic changes
parent
ee41a705
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
9 deletions
+55
-9
modules/misc/network/ipv6.c
modules/misc/network/ipv6.c
+55
-9
No files found.
modules/misc/network/ipv6.c
View file @
4b00d01a
...
...
@@ -70,6 +70,16 @@ static const struct in6_addr in6addr_any = {{IN6ADDR_ANY_INIT}};
# define close closesocket
#endif
#ifndef MCAST_JOIN_SOURCE_GROUP
# define MCAST_JOIN_SOURCE_GROUP 46
struct
group_source_req
{
uint32_t
gsr_interface
;
/* interface index */
struct
sockaddr_storage
gsr_group
;
/* group address */
struct
sockaddr_storage
gsr_source
;
/* source address */
};
#endif
/*****************************************************************************
* Local prototypes
*****************************************************************************/
...
...
@@ -232,6 +242,41 @@ static int OpenUDP( vlc_object_t * p_this )
#if defined( WIN32 ) || defined( HAVE_IF_NAMETOINDEX )
if
(
IN6_IS_ADDR_MULTICAST
(
&
sock
.
sin6_addr
)
)
{
if
(
*
psz_server_addr
)
{
struct
group_source_req
imr
;
struct
sockaddr_in6
*
p_sin6
;
imr
.
gsr_interface
=
0
;
imr
.
gsr_group
.
ss_family
=
AF_INET6
;
imr
.
gsr_source
.
ss_family
=
AF_INET6
;
p_sin6
=
(
struct
sockaddr_in6
*
)
&
imr
.
gsr_group
;
p_sin6
->
sin6_addr
=
sock
.
sin6_addr
;
/* Build socket for remote connection */
msg_Dbg
(
p_this
,
"psz_server_addr : %s"
,
psz_server_addr
);
if
(
BuildAddr
(
p_this
,
&
sock
,
psz_server_addr
,
i_server_port
)
)
{
msg_Warn
(
p_this
,
"cannot build remote address"
);
close
(
i_handle
);
return
(
-
1
);
}
p_sin6
=
(
struct
sockaddr_in6
*
)
&
imr
.
gsr_source
;
p_sin6
->
sin6_addr
=
sock
.
sin6_addr
;
msg_Dbg
(
p_this
,
"IPV6_ADD_SOURCE_MEMBERSHIP multicast request"
);
if
(
setsockopt
(
i_handle
,
IPPROTO_IPV6
,
MCAST_JOIN_SOURCE_GROUP
,
(
char
*
)
&
imr
,
sizeof
(
struct
group_source_req
)
)
==
-
1
)
{
msg_Err
(
p_this
,
"failed to join IP multicast group (%s)"
,
strerror
(
errno
)
);
}
}
else
{
struct
ipv6_mreq
imr
;
int
res
;
...
...
@@ -249,6 +294,7 @@ static int OpenUDP( vlc_object_t * p_this )
msg_Err
(
p_this
,
"cannot join multicast group"
);
}
}
}
#else
msg_Warn
(
p_this
,
"Multicast IPv6 is not supported on your OS"
);
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment