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
2cce4b1d
Commit
2cce4b1d
authored
Jun 12, 2003
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/misc/network/ipv6.c: gave a quick try to implementing ttl for ipv6.
parent
cae87218
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletion
+43
-1
modules/misc/network/ipv6.c
modules/misc/network/ipv6.c
+43
-1
No files found.
modules/misc/network/ipv6.c
View file @
2cce4b1d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* ipv6.c: IPv6 network abstraction layer
* ipv6.c: IPv6 network abstraction layer
*****************************************************************************
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* Copyright (C) 2002 VideoLAN
* $Id: ipv6.c,v 1.1
0 2003/06/06 11:09:24
gbazin Exp $
* $Id: ipv6.c,v 1.1
1 2003/06/12 23:03:09
gbazin Exp $
*
*
* Authors: Alexis Guillard <alexis.guillard@bt.com>
* Authors: Alexis Guillard <alexis.guillard@bt.com>
* Christophe Massiot <massiot@via.ecp.fr>
* Christophe Massiot <massiot@via.ecp.fr>
...
@@ -65,6 +65,12 @@ static const struct in6_addr in6addr_any = {{IN6ADDR_ANY_INIT}};
...
@@ -65,6 +65,12 @@ static const struct in6_addr in6addr_any = {{IN6ADDR_ANY_INIT}};
#ifndef IPV6_JOIN_GROUP
#ifndef IPV6_JOIN_GROUP
# define IPV6_JOIN_GROUP 20
# define IPV6_JOIN_GROUP 20
#endif
#endif
#ifndef IPV6_MULTICAST_HOPS
# define IPV6_MULTICAST_HOPS 18
#endif
#ifndef IPV6_UNICAST_HOPS
# define IPV6_UNICAST_HOPS 16
#endif
# define close closesocket
# define close closesocket
#endif
#endif
...
@@ -340,6 +346,9 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket )
...
@@ -340,6 +346,9 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket )
if
(
*
psz_server_addr
)
if
(
*
psz_server_addr
)
{
{
int
ttl
=
config_GetInt
(
p_this
,
"ttl"
);
if
(
ttl
<
1
)
ttl
=
1
;
/* Build socket for remote connection */
/* Build socket for remote connection */
if
(
BuildAddr
(
p_this
,
&
sock
,
psz_server_addr
,
i_server_port
)
==
-
1
)
if
(
BuildAddr
(
p_this
,
&
sock
,
psz_server_addr
,
i_server_port
)
==
-
1
)
{
{
...
@@ -356,6 +365,39 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket )
...
@@ -356,6 +365,39 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket )
close
(
i_handle
);
close
(
i_handle
);
return
(
-
1
);
return
(
-
1
);
}
}
/* Set the time-to-live */
if
(
ttl
>
1
)
{
#if defined(WIN32) || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
if
(
IN6_IS_ADDR_MULTICAST
(
&
sock
.
sin6_addr
)
)
{
if
(
setsockopt
(
i_handle
,
IPPROTO_IPV6
,
IPV6_MULTICAST_HOPS
,
(
void
*
)
&
ttl
,
sizeof
(
ttl
)
)
<
0
)
{
#ifdef HAVE_ERRNO_H
msg_Warn
(
p_this
,
"failed to set multicast ttl (%s)"
,
strerror
(
errno
)
);
#else
msg_Warn
(
p_this
,
"failed to set multicast ttl"
);
#endif
}
}
else
{
if
(
setsockopt
(
i_handle
,
IPPROTO_IPV6
,
IPV6_UNICAST_HOPS
,
(
void
*
)
&
ttl
,
sizeof
(
ttl
)
)
<
0
)
{
#ifdef HAVE_ERRNO_H
msg_Warn
(
p_this
,
"failed to set unicast ttl (%s)"
,
strerror
(
errno
)
);
#else
msg_Warn
(
p_this
,
"failed to set unicast ttl"
);
#endif
}
}
#endif
}
}
}
p_socket
->
i_handle
=
i_handle
;
p_socket
->
i_handle
=
i_handle
;
...
...
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