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
6a389c94
Commit
6a389c94
authored
Jul 29, 2004
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ipv4.c: ttl setsockopt fix. Thanks to Emmanuel Dreyfus for reporting
parent
6c4b8e5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
9 deletions
+22
-9
modules/misc/network/ipv4.c
modules/misc/network/ipv4.c
+22
-9
No files found.
modules/misc/network/ipv4.c
View file @
6a389c94
...
...
@@ -409,23 +409,36 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket )
if
(
IN_MULTICAST
(
ntohl
(
inet_addr
(
psz_server_addr
)
)
)
)
{
/* set the time-to-live */
int
ttl
=
p_socket
->
i_ttl
;
if
(
ttl
<
1
)
int
i_ttl
=
p_socket
->
i_ttl
;
unsigned
char
ttl
;
if
(
i_ttl
<
1
)
{
ttl
=
config_GetInt
(
p_this
,
"
ttl"
);
i_ttl
=
config_GetInt
(
p_this
,
"i_
ttl"
);
}
if
(
ttl
<
1
)
ttl
=
1
;
if
(
i_ttl
<
1
)
i_ttl
=
1
;
ttl
=
(
unsigned
char
)
i_ttl
;
/* There is some confusion in the world whether IP_MULTICAST_TTL
* takes a byte or an int as an argument. BSD seems to indicate byte
* so we are going with that and use int as a fallback to be safe */
if
(
setsockopt
(
i_handle
,
IPPROTO_IP
,
IP_MULTICAST_TTL
,
(
void
*
)
&
ttl
,
sizeof
(
ttl
)
)
<
0
)
&
ttl
,
sizeof
(
ttl
)
)
<
0
)
{
#ifdef HAVE_ERRNO_H
msg_Err
(
p_this
,
"failed to set ttl (%s)"
,
strerror
(
errno
)
);
msg_Dbg
(
p_this
,
"failed to set ttl (%s). Let's try it the integer way."
,
strerror
(
errno
)
);
#endif
if
(
setsockopt
(
i_handle
,
IPPROTO_IP
,
IP_MULTICAST_TTL
,
&
i_ttl
,
sizeof
(
i_ttl
)
)
<
0
)
{
#ifdef HAVE_ERRNO_H
msg_Err
(
p_this
,
"failed to set ttl (%s)"
,
strerror
(
errno
)
);
#else
msg_Err
(
p_this
,
"failed to set ttl"
);
msg_Err
(
p_this
,
"failed to set ttl"
);
#endif
close
(
i_handle
);
return
(
-
1
);
close
(
i_handle
);
return
(
-
1
);
}
}
}
#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