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
edf6862b
Commit
edf6862b
authored
Feb 28, 2007
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sap.c: win32 fix for IPv6 local-link zone identifier
parent
cfb2689c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
modules/services_discovery/sap.c
modules/services_discovery/sap.c
+29
-1
No files found.
modules/services_discovery/sap.c
View file @
edf6862b
...
...
@@ -49,7 +49,10 @@
#ifdef HAVE_ZLIB_H
# include <zlib.h>
#endif
#include <net/if.h>
#ifndef WIN32
# include <net/if.h>
#endif
/************************************************************************
* Macros and definitions
...
...
@@ -492,6 +495,7 @@ static void Run( services_discovery_t *p_sd )
{
char
psz_address
[
NI_MAXNUMERICHOST
]
=
"ff02::2:7ffe%"
;
#ifndef WIN32
struct
if_nameindex
*
l
=
if_nameindex
();
if
(
l
!=
NULL
)
{
...
...
@@ -503,6 +507,30 @@ static void Run( services_discovery_t *p_sd )
}
if_freenameindex
(
l
);
}
#else
/* this is the Winsock2 equivalant of SIOCGIFCONF on BSD stacks,
which if_nameindex uses internally anyway */
// first create a dummy socket to pin down the protocol family
SOCKET
s
=
socket
(
PF_INET6
,
SOCK_DGRAM
,
IPPROTO_UDP
);
if
(
s
!=
INVALID_SOCKET
)
{
INTERFACE_INFO
ifaces
[
10
];
// Assume there will be no more than 10 IP interfaces
size_t
len
=
sizeof
(
ifaces
);
if
(
SOCKET_ERROR
!=
WSAIoctl
(
s
,
SIO_GET_INTERFACE_LIST
,
NULL
,
0
,
&
ifaces
,
len
,
&
len
,
NULL
,
NULL
)
)
{
unsigned
ifcount
=
len
/
sizeof
(
INTERFACE_INFO
);
char
*
ptr
=
strchr
(
psz_address
,
'%'
)
+
1
;
for
(
unsigned
i
=
1
;
i
<=
ifcount
;
++
i
)
{
// append link-local zone identifier
sprintf
(
ptr
,
"%d"
,
i
);
}
}
closesocket
(
s
);
}
#endif
*
strchr
(
psz_address
,
'%'
)
=
'\0'
;
static
const
char
ipv6_scopes
[]
=
"1456789ABCDE"
;
...
...
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