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
f6268a0a
Commit
f6268a0a
authored
Feb 27, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Listen to link-local SAP announces too
parent
3ecee5c4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
modules/services_discovery/sap.c
modules/services_discovery/sap.c
+18
-12
No files found.
modules/services_discovery/sap.c
View file @
f6268a0a
...
...
@@ -49,6 +49,7 @@
#ifdef HAVE_ZLIB_H
# include <zlib.h>
#endif
#include <net/if.h>
/************************************************************************
* Macros and definitions
...
...
@@ -68,14 +69,6 @@
#define SAP_V4_LINK_ADDRESS "224.0.0.255"
#define ADD_SESSION 1
#define SAP_V6_1 "FF0"
/* Scope is inserted between them */
#define SAP_V6_2 "::2:7FFE"
/* See RFC3513 for list of valid scopes */
/* FIXME: find a way to listen to link-local scope */
static
const
char
ipv6_scopes
[]
=
"1456789ABCDE"
;
/*****************************************************************************
* Module descriptor
*****************************************************************************/
...
...
@@ -497,12 +490,25 @@ static void Run( services_discovery_t *p_sd )
}
if
(
var_CreateGetInteger
(
p_sd
,
"sap-ipv6"
)
)
{
char
psz_address
[]
=
SAP_V6_1
"0"
SAP_V6_2
;
const
char
*
c_scope
;
char
psz_address
[
NI_MAXNUMERICHOST
]
=
"ff02::2:7ffe%"
;
struct
if_nameindex
*
l
=
if_nameindex
();
if
(
l
!=
NULL
)
{
char
*
ptr
=
strchr
(
psz_address
,
'%'
)
+
1
;
for
(
unsigned
i
=
0
;
l
[
i
].
if_index
;
i
++
)
{
strcpy
(
ptr
,
l
[
i
].
if_name
);
InitSocket
(
p_sd
,
psz_address
,
SAP_PORT
);
}
if_freenameindex
(
l
);
}
*
strchr
(
psz_address
,
'%'
)
=
'\0'
;
for
(
c_scope
=
ipv6_scopes
;
*
c_scope
;
c_scope
++
)
static
const
char
ipv6_scopes
[]
=
"1456789ABCDE"
;
for
(
const
char
*
c_scope
=
ipv6_scopes
;
*
c_scope
;
c_scope
++
)
{
psz_address
[
sizeof
(
SAP_V6_1
)
-
1
]
=
*
c_scope
;
psz_address
[
3
]
=
*
c_scope
;
InitSocket
(
p_sd
,
psz_address
,
SAP_PORT
);
}
}
...
...
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