Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
9db36c2d
Commit
9db36c2d
authored
Oct 18, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't assume multicast address are in dotted notation - fixes #780.
Not tested. Needs testing + backport.
parent
40dd14a2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
modules/misc/network/ipv4.c
modules/misc/network/ipv4.c
+21
-21
No files found.
modules/misc/network/ipv4.c
View file @
9db36c2d
...
@@ -215,42 +215,42 @@ static int OpenUDP( vlc_object_t * p_this )
...
@@ -215,42 +215,42 @@ static int OpenUDP( vlc_object_t * p_this )
#endif
#endif
/* Build the local socket */
/* Build the local socket */
#if defined( WIN32 ) || defined( UNDER_CE )
/* Under Win32 and for multicasting, we bind to INADDR_ANY,
* so let's call BuildAddr with "" instead of psz_bind_addr */
if
(
BuildAddr
(
p_this
,
&
sock
,
IN_MULTICAST
(
ntohl
(
inet_addr
(
psz_bind_addr
)
)
)
?
""
:
psz_bind_addr
,
i_bind_port
)
==
-
1
)
#else
if
(
BuildAddr
(
p_this
,
&
sock
,
psz_bind_addr
,
i_bind_port
)
==
-
1
)
if
(
BuildAddr
(
p_this
,
&
sock
,
psz_bind_addr
,
i_bind_port
)
==
-
1
)
#endif
{
{
msg_Dbg
(
p_this
,
"could not build local address"
);
msg_Dbg
(
p_this
,
"could not build local address"
);
close
(
i_handle
);
close
(
i_handle
);
return
0
;
return
0
;
}
}
/* Bind it */
if
(
bind
(
i_handle
,
(
struct
sockaddr
*
)
&
sock
,
sizeof
(
sock
)
)
<
0
)
{
msg_Warn
(
p_this
,
"cannot bind socket (%s)"
,
strerror
(
errno
)
);
close
(
i_handle
);
return
0
;
}
#if defined( WIN32 ) || defined( UNDER_CE )
#if defined( WIN32 ) || defined( UNDER_CE )
/* Restore the sock struct so we can spare a few #ifdef WIN32 later on */
/*
if
(
IN_MULTICAST
(
ntohl
(
inet_addr
(
psz_bind_addr
)
)
)
)
* Under Win32 and for multicasting, we bind to INADDR_ANY.
* This is of course a severe bug, since the socket would logically
* receive unicast traffic, and multicast traffic of groups subscribed
* to via other sockets. How this actually works in Winsock, I don't
* know.
*/
if
(
IN_MULTICAST
(
ntohl
(
sock
.
sin_addr
.
s_addr
)
)
)
{
{
if
(
BuildAddr
(
p_this
,
&
sock
,
psz_bind_addr
,
i_bind_port
)
==
-
1
)
struct
sockaddr_in
stupid
=
sock
;
stupid
.
sin_addr
.
s_addr
=
INADDR_ANY
;
if
(
bind
(
i_handle
,
(
struct
sockaddr
*
)
&
stupid
,
sizeof
(
sock
)
<
0
)
)
{
{
msg_
Dbg
(
p_this
,
"could not build local address"
);
msg_
Warn
(
p_this
,
"cannot bind socket (%d)"
,
WSA_GetLastError
()
);
close
(
i_handle
);
close
(
i_handle
);
return
0
;
return
0
;
}
}
}
}
else
#endif
#endif
/* Bind it */
if
(
bind
(
i_handle
,
(
struct
sockaddr
*
)
&
sock
,
sizeof
(
sock
)
)
<
0
)
{
msg_Warn
(
p_this
,
"cannot bind socket (%s)"
,
strerror
(
errno
)
);
close
(
i_handle
);
return
0
;
}
#if !defined( SYS_BEOS )
#if !defined( SYS_BEOS )
/* Allow broadcast reception if we bound on INADDR_ANY */
/* Allow broadcast reception if we bound on INADDR_ANY */
...
...
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