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
cd0c18be
Commit
cd0c18be
authored
Jul 09, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Jul 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Support IPv6 in GetAddress.
parent
78b81323
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
utility.c
dlls/wininet/utility.c
+14
-2
No files found.
dlls/wininet/utility.c
View file @
cd0c18be
...
...
@@ -178,14 +178,23 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
#ifdef HAVE_GETADDRINFO
memset
(
&
hints
,
0
,
sizeof
(
struct
addrinfo
)
);
/* Prefer IPv4 to IPv6 addresses, since some servers do not listen on
* their IPv6 addresses even though they have IPv6 addresses in the DNS.
*/
hints
.
ai_family
=
AF_INET
;
ret
=
getaddrinfo
(
name
,
NULL
,
&
hints
,
&
res
);
HeapFree
(
GetProcessHeap
(),
0
,
name
);
if
(
ret
!=
0
)
{
TRACE
(
"failed to get address of %s (%s)
\n
"
,
debugstr_w
(
lpszServerName
),
gai_strerror
(
ret
));
return
FALSE
;
TRACE
(
"failed to get IPv4 address of %s (%s), retrying with IPv6
\n
"
,
debugstr_w
(
lpszServerName
),
gai_strerror
(
ret
));
hints
.
ai_family
=
AF_INET6
;
ret
=
getaddrinfo
(
name
,
NULL
,
&
hints
,
&
res
);
if
(
ret
!=
0
)
{
TRACE
(
"failed to get address of %s (%s)
\n
"
,
debugstr_w
(
lpszServerName
),
gai_strerror
(
ret
));
return
FALSE
;
}
}
if
(
*
sa_len
<
res
->
ai_addrlen
)
{
...
...
@@ -201,6 +210,9 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
case
AF_INET
:
((
struct
sockaddr_in
*
)
psa
)
->
sin_port
=
htons
(
nServerPort
);
break
;
case
AF_INET6
:
((
struct
sockaddr_in6
*
)
psa
)
->
sin6_port
=
htons
(
nServerPort
);
break
;
}
freeaddrinfo
(
res
);
...
...
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