Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
5b8e4c0b
Commit
5b8e4c0b
authored
Feb 11, 2007
by
Rémi Denis-Courmont
Browse files
Fix link-scoped IPv6 addresses
parent
6bf818a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/stream_output/sdp.c
View file @
5b8e4c0b
...
...
@@ -38,36 +38,37 @@ char *AddressToSDP (const struct sockaddr *addr, socklen_t addrlen, char *buf)
+
sizeof
(
addr
->
sa_family
))
return
NULL
;
const
char
*
ttl
=
NULL
;
strcpy
(
buf
,
"IN IP* "
);
if
(
vlc_getnameinfo
(
addr
,
addrlen
,
buf
+
7
,
MAXSDPADDRESS
-
7
,
NULL
,
NI_NUMERICHOST
))
return
NULL
;
switch
(
addr
->
sa_family
)
{
case
AF_INET
:
{
if
(
net_SockAddrIsMulticast
(
addr
,
addrlen
))
ttl
=
"/255"
;
// obsolete in RFC4566, dummy value
strcat
(
buf
,
"/255"
)
;
// obsolete in RFC4566, dummy value
buf
[
5
]
=
'4'
;
break
;
}
#ifdef AF_INET6
case
AF_INET6
:
{
char
*
ptr
=
strchr
(
buf
,
'%'
);
if
(
ptr
!=
NULL
)
*
ptr
=
'\0'
;
// remove scope ID
buf
[
5
]
=
'6'
;
break
;
}
#endif
default:
return
NULL
;
}
if
(
vlc_getnameinfo
(
addr
,
addrlen
,
buf
+
7
,
MAXSDPADDRESS
-
7
,
NULL
,
NI_NUMERICHOST
))
return
NULL
;
if
(
ttl
!=
NULL
)
strcat
(
buf
,
ttl
);
return
buf
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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