Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
7a689266
Commit
7a689266
authored
Nov 24, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Darwin compile fix
parent
b7110f8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
26 deletions
+25
-26
src/network/udp.c
src/network/udp.c
+25
-26
No files found.
src/network/udp.c
View file @
7a689266
...
...
@@ -316,21 +316,7 @@ net_SourceSubscribe (vlc_object_t *obj, int fd,
const
struct
sockaddr
*
src
,
socklen_t
srclen
,
const
struct
sockaddr
*
grp
,
socklen_t
grplen
)
{
/* Agnostic ASM/SSM multicast join */
#ifdef MCAST_JOIN_SOURCE_GROUP
union
{
struct
group_req
gr
;
struct
group_source_req
gsr
;
}
opt
;
socklen_t
optlen
;
int
level
,
iid
=
0
;
vlc_bool_t
ssm
=
VLC_TRUE
;
if
(
src
==
NULL
)
ssm
=
VLC_FALSE
;
memset
(
&
opt
,
0
,
sizeof
(
opt
));
char
*
iface
=
var_CreateGetString
(
obj
,
"miface"
);
if
(
iface
!=
NULL
)
...
...
@@ -350,23 +336,25 @@ net_SourceSubscribe (vlc_object_t *obj, int fd,
switch
(
grp
->
sa_family
)
{
#ifdef AF_INET6
case
AF_INET6
:
level
=
SOL_IPV6
;
if
(
ssm
if
(
(
src
!=
NULL
)
&&
memcmp
(
&
((
const
struct
sockaddr_in6
*
)
src
)
->
sin6_addr
,
&
in6addr_any
,
sizeof
(
in6addr_any
))
==
0
)
s
sm
=
VLC_FALSE
;
s
rc
=
NULL
;
if
(((
const
struct
sockaddr_in6
*
)
src
)
->
sin6_scope_id
)
iid
=
((
const
struct
sockaddr_in6
*
)
src
)
->
sin6_scope_id
;
break
;
#endif
case
AF_INET
:
level
=
SOL_IP
;
if
(
ssm
if
(
(
src
!=
NULL
)
&&
((
const
struct
sockaddr_in
*
)
src
)
->
sin_addr
.
s_addr
==
INADDR_ANY
)
s
sm
=
VLC_FALSE
;
s
rc
=
NULL
;
break
;
default:
...
...
@@ -374,7 +362,18 @@ net_SourceSubscribe (vlc_object_t *obj, int fd,
return
-
1
;
}
if
(
ssm
)
/* Agnostic ASM/SSM multicast join */
#ifdef MCAST_JOIN_SOURCE_GROUP
union
{
struct
group_req
gr
;
struct
group_source_req
gsr
;
}
opt
;
socklen_t
optlen
;
memset
(
&
opt
,
0
,
sizeof
(
opt
));
if
(
src
!=
NULL
)
{
if
((
grplen
>
sizeof
(
opt
.
gsr
.
gsr_group
))
||
(
srclen
>
sizeof
(
opt
.
gsr
.
gsr_source
)))
...
...
@@ -395,23 +394,23 @@ net_SourceSubscribe (vlc_object_t *obj, int fd,
optlen
=
sizeof
(
opt
.
gr
);
}
msg_Dbg
(
obj
,
"Multicast %sgroup join request"
,
s
sm
?
"source "
:
""
);
msg_Dbg
(
obj
,
"Multicast %sgroup join request"
,
s
rc
?
"source "
:
""
);
if
(
setsockopt
(
fd
,
level
,
s
sm
?
MCAST_JOIN_SOURCE_GROUP
:
MCAST_JOIN_GROUP
,
if
(
setsockopt
(
fd
,
level
,
s
rc
?
MCAST_JOIN_SOURCE_GROUP
:
MCAST_JOIN_GROUP
,
(
void
*
)
&
opt
,
optlen
)
==
0
)
return
0
;
#endif
/* Fallback to IPv-specific APIs */
if
(
ssm
&&
(
src
->
sa_family
!=
grp
->
sa_family
))
if
(
(
src
!=
NULL
)
&&
(
src
->
sa_family
!=
grp
->
sa_family
))
return
-
1
;
switch
(
grp
->
sa_family
)
{
case
AF_INET
:
if
((
grplen
<
sizeof
(
struct
sockaddr_in
))
||
(
ssm
&&
(
srclen
<
sizeof
(
struct
sockaddr_in
))))
||
(
(
src
!=
NULL
)
&&
(
srclen
<
sizeof
(
struct
sockaddr_in
))))
return
-
1
;
if
(
net_IPv4Join
(
obj
,
fd
,
(
const
struct
sockaddr_in
*
)
src
,
...
...
@@ -422,7 +421,7 @@ net_SourceSubscribe (vlc_object_t *obj, int fd,
#ifdef AF_INET6
case
AF_INET6
:
if
((
grplen
<
sizeof
(
struct
sockaddr_in6
))
||
(
ssm
&&
(
srclen
<
sizeof
(
struct
sockaddr_in6
))))
||
(
(
src
!=
NULL
)
&&
(
srclen
<
sizeof
(
struct
sockaddr_in6
))))
return
-
1
;
/* We don't provide IPv6-specific SSM at the moment.
...
...
@@ -437,7 +436,7 @@ net_SourceSubscribe (vlc_object_t *obj, int fd,
msg_Err
(
obj
,
"Multicast group join error (%s)"
,
net_strerror
(
net_errno
));
if
(
s
sm
)
if
(
s
rc
!=
NULL
)
{
msg_Warn
(
obj
,
"Trying ASM instead of SSM..."
);
return
net_Subscribe
(
obj
,
fd
,
grp
,
grplen
);
...
...
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