Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
80d629ac
Commit
80d629ac
authored
Sep 04, 2023
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wpcap: Call GetAdaptersAddresses() in a loop.
parent
d01e619c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
wpcap.c
dlls/wpcap/wpcap.c
+10
-7
No files found.
dlls/wpcap/wpcap.c
View file @
80d629ac
...
...
@@ -391,18 +391,21 @@ static void free_devices( struct pcap_interface *devs )
static
IP_ADAPTER_ADDRESSES
*
get_adapters
(
void
)
{
DWORD
size
=
0
;
IP_ADAPTER_ADDRESSES
*
ret
;
ULONG
err
,
size
=
4096
;
IP_ADAPTER_ADDRESSES
*
tmp
,
*
ret
;
ULONG
flags
=
GAA_FLAG_SKIP_ANYCAST
|
GAA_FLAG_SKIP_MULTICAST
|
GAA_FLAG_SKIP_DNS_SERVER
;
if
(
GetAdaptersAddresses
(
AF_UNSPEC
,
flags
,
NULL
,
NULL
,
&
size
)
!=
ERROR_BUFFER_OVERFLOW
)
return
NULL
;
if
(
!
(
ret
=
malloc
(
size
)))
return
NULL
;
if
(
GetAdaptersAddresses
(
AF_UNSPEC
,
flags
,
NULL
,
ret
,
&
size
))
err
=
GetAdaptersAddresses
(
AF_UNSPEC
,
flags
,
NULL
,
ret
,
&
size
);
while
(
err
==
ERROR_BUFFER_OVERFLOW
)
{
free
(
ret
);
return
NULL
;
if
(
!
(
tmp
=
realloc
(
ret
,
size
)))
break
;
ret
=
tmp
;
err
=
GetAdaptersAddresses
(
AF_UNSPEC
,
flags
,
NULL
,
ret
,
&
size
);
}
return
ret
;
if
(
err
==
ERROR_SUCCESS
)
return
ret
;
free
(
ret
);
return
NULL
;
}
static
IP_ADAPTER_ADDRESSES
*
find_adapter
(
IP_ADAPTER_ADDRESSES
*
list
,
const
char
*
name
)
...
...
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