Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
accf5ef5
Commit
accf5ef5
authored
Jun 13, 2017
by
Owen Rudge
Committed by
Alexandre Julliard
Jun 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Extract IPv6 address from brackets in getaddrinfo.
Signed-off-by:
Bruno Jesus
<
bjesus@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f254aec4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
socket.c
dlls/ws2_32/socket.c
+23
-1
No files found.
dlls/ws2_32/socket.c
View file @
accf5ef5
...
...
@@ -6557,7 +6557,7 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
struct
addrinfo
*
unixaires
=
NULL
;
int
result
;
struct
addrinfo
unixhints
,
*
punixhints
=
NULL
;
char
*
hostname
;
char
*
hostname
,
*
nodeV6
=
NULL
;
const
char
*
node
;
*
res
=
NULL
;
...
...
@@ -6575,8 +6575,28 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
else
if
(
!
nodename
[
0
])
node
=
hostname
;
else
{
node
=
nodename
;
/* Check for [ipv6] or [ipv6]:portnumber, which are supported by Windows */
if
(
!
hints
||
hints
->
ai_family
==
WS_AF_UNSPEC
||
hints
->
ai_family
==
WS_AF_INET6
)
{
char
*
close_bracket
;
if
(
node
[
0
]
==
'['
&&
(
close_bracket
=
strchr
(
node
+
1
,
']'
)))
{
nodeV6
=
HeapAlloc
(
GetProcessHeap
(),
0
,
close_bracket
-
node
);
if
(
!
nodeV6
)
{
HeapFree
(
GetProcessHeap
(),
0
,
hostname
);
return
WSA_NOT_ENOUGH_MEMORY
;
}
lstrcpynA
(
nodeV6
,
node
+
1
,
close_bracket
-
node
);
node
=
nodeV6
;
}
}
}
/* servname tweak required by OSX and BSD kernels */
if
(
servname
&&
!
servname
[
0
])
servname
=
"0"
;
...
...
@@ -6598,6 +6618,7 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
{
SetLastError
(
WSAESOCKTNOSUPPORT
);
HeapFree
(
GetProcessHeap
(),
0
,
hostname
);
HeapFree
(
GetProcessHeap
(),
0
,
nodeV6
);
return
SOCKET_ERROR
;
}
...
...
@@ -6630,6 +6651,7 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr
}
TRACE
(
"%s, %s %p -> %p %d
\n
"
,
debugstr_a
(
nodename
),
debugstr_a
(
servname
),
hints
,
res
,
result
);
HeapFree
(
GetProcessHeap
(),
0
,
hostname
);
HeapFree
(
GetProcessHeap
(),
0
,
nodeV6
);
if
(
!
result
)
{
struct
addrinfo
*
xuai
=
unixaires
;
...
...
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