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
fbd6b258
Commit
fbd6b258
authored
Feb 23, 2024
by
Paul Gofman
Committed by
Alexandre Julliard
Feb 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Partially fill Ipv4 / Ipv6 metric in GetAdaptersAddresses().
parent
ee069253
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+14
-7
No files found.
dlls/iphlpapi/iphlpapi_main.c
View file @
fbd6b258
...
...
@@ -993,6 +993,7 @@ static DWORD gateway_and_prefix_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG
{
struct
nsi_ipv4_forward_key
*
key4
;
struct
nsi_ipv6_forward_key
*
key6
;
struct
nsi_ip_forward_rw
*
rw
;
IP_ADAPTER_GATEWAY_ADDRESS
*
gw
,
**
gw_next
;
IP_ADAPTER_PREFIX
*
prefix
,
**
prefix_next
;
DWORD
err
,
count
,
i
,
prefix_len
,
key_size
=
(
family
==
AF_INET
)
?
sizeof
(
*
key4
)
:
sizeof
(
*
key6
);
...
...
@@ -1002,11 +1003,14 @@ static DWORD gateway_and_prefix_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG
void
*
key
;
err
=
NsiAllocateAndGetTable
(
1
,
ip_module_id
(
family
),
NSI_IP_FORWARD_TABLE
,
&
key
,
key_size
,
NULL
,
0
,
NULL
,
0
,
NULL
,
0
,
&
count
,
0
);
(
void
**
)
&
rw
,
sizeof
(
*
rw
)
,
NULL
,
0
,
NULL
,
0
,
&
count
,
0
);
if
(
err
)
return
err
;
while
(
aa
)
{
if
(
family
==
AF_INET
)
aa
->
Ipv4Metric
=
~
0u
;
else
aa
->
Ipv6Metric
=
~
0u
;
for
(
gw_next
=
&
aa
->
FirstGatewayAddress
;
*
gw_next
;
gw_next
=
&
(
*
gw_next
)
->
Next
)
;
for
(
prefix_next
=
&
aa
->
FirstPrefix
;
*
prefix_next
;
prefix_next
=
&
(
*
prefix_next
)
->
Next
)
...
...
@@ -1019,6 +1023,12 @@ static DWORD gateway_and_prefix_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG
luid
=
(
family
==
AF_INET
)
?
&
key4
->
luid
:
&
key6
->
luid
;
if
(
luid
->
Value
!=
aa
->
Luid
.
Value
)
continue
;
if
(
rw
[
i
].
metric
)
{
if
(
family
==
AF_INET
)
aa
->
Ipv4Metric
=
min
(
aa
->
Ipv4Metric
,
rw
[
i
].
metric
);
else
aa
->
Ipv6Metric
=
min
(
aa
->
Ipv6Metric
,
rw
[
i
].
metric
);
}
if
(
flags
&
GAA_FLAG_INCLUDE_GATEWAYS
)
{
memset
(
&
sockaddr
,
0
,
sizeof
(
sockaddr
)
);
...
...
@@ -1103,7 +1113,7 @@ static DWORD gateway_and_prefix_addresses_alloc( IP_ADAPTER_ADDRESSES *aa, ULONG
}
err:
NsiFreeTable
(
key
,
NULL
,
NULL
,
NULL
);
NsiFreeTable
(
key
,
rw
,
NULL
,
NULL
);
return
err
;
}
...
...
@@ -1269,11 +1279,8 @@ static DWORD adapters_addresses_alloc( ULONG family, ULONG flags, IP_ADAPTER_ADD
if
(
err
)
goto
err
;
}
if
(
flags
&
(
GAA_FLAG_INCLUDE_GATEWAYS
|
GAA_FLAG_INCLUDE_PREFIX
))
{
err
=
call_families
(
gateway_and_prefix_addresses_alloc
,
aa
,
family
,
flags
);
if
(
err
)
goto
err
;
}
err
=
call_families
(
gateway_and_prefix_addresses_alloc
,
aa
,
family
,
flags
);
if
(
err
)
goto
err
;
err
=
dns_info_alloc
(
aa
,
family
,
flags
);
if
(
err
)
goto
err
;
...
...
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