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
8b8ea5e9
Commit
8b8ea5e9
authored
Feb 12, 2007
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
udp.c: MakeRandMulticast fix for win32, courmisch to review
parent
d8a3ed85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
modules/access_output/udp.c
modules/access_output/udp.c
+22
-0
No files found.
modules/access_output/udp.c
View file @
8b8ea5e9
...
...
@@ -653,7 +653,16 @@ static const char *MakeRandMulticast (int family, char *buf, size_t buflen)
"
\x00\x00\x00\x00
"
,
12
);
rand
|=
0x80000000
;
memcpy
(
addr
.
s6_addr
+
12
,
&
(
uint32_t
){
htonl
(
rand
)
},
4
);
#if defined(WIN32) || defined(UNDER_CE)
if
(
0
==
WSAAddressToStringA
((
LPSOCKADDR
)
&
addr
,
sizeof
(
struct
in6_addr
),
NULL
,
buf
,
&
buflen
)
)
{
buf
[
buflen
]
=
'\0'
;
return
buf
;
}
return
NULL
;
#else
return
inet_ntop
(
family
,
&
addr
,
buf
,
buflen
);
#endif
}
#endif
...
...
@@ -661,9 +670,22 @@ static const char *MakeRandMulticast (int family, char *buf, size_t buflen)
{
struct
in_addr
addr
;
addr
.
s_addr
=
htonl
((
rand
&
0xffffff
)
|
0xe8000000
);
#if defined(WIN32) || defined(UNDER_CE)
if
(
0
==
WSAAddressToStringA
((
LPSOCKADDR
)
&
addr
,
sizeof
(
struct
in_addr
),
NULL
,
buf
,
&
buflen
)
)
{
buf
[
buflen
]
=
'\0'
;
return
buf
;
}
return
NULL
;
#else
return
inet_ntop
(
family
,
&
addr
,
buf
,
buflen
);
#endif
}
}
#if defined(WIN32) || defined(UNDER_CE)
WSASetLastError
(
WSAEAFNOSUPPORT
);
#else
errno
=
EAFNOSUPPORT
;
#endif
return
NULL
;
}
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