aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-02-15 04:04:53 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-02-15 04:04:53 +0000
commit79d7f1f732d070abed9990caff2d775f1b0aca2b (patch)
tree8aaaeb612b6c3a1e3fb9647f0da35e8cf285a502
parent40b2cf3f0b790a10b588e1f3a255462825dd630c (diff)
parenta1f37d7e15e391e1973053f8d58f07e4d240f1b4 (diff)
downloadopenscreen-79d7f1f732d070abed9990caff2d775f1b0aca2b.tar.gz
Change-Id: I13566d37a050980c9261fd2a52e5bbff2ebbc6f0
-rw-r--r--platform/impl/network_interface_win.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/platform/impl/network_interface_win.cc b/platform/impl/network_interface_win.cc
index f90d35d2..c3095457 100644
--- a/platform/impl/network_interface_win.cc
+++ b/platform/impl/network_interface_win.cc
@@ -16,7 +16,6 @@ std::vector<InterfaceInfo> GetAllInterfaces() {
constexpr size_t INITIAL_BUFFER_SIZE = 15000;
ULONG outbuflen = INITIAL_BUFFER_SIZE;
std::vector<unsigned char> charbuf(INITIAL_BUFFER_SIZE);
- PIP_ADAPTER_ADDRESSES paddrs = reinterpret_cast<IP_ADAPTER_ADDRESSES*>(charbuf.data());
DWORD ret = NO_ERROR;
constexpr int MAX_RETRIES = 5;
@@ -25,7 +24,7 @@ std::vector<InterfaceInfo> GetAllInterfaces() {
ret = GetAdaptersAddresses(AF_UNSPEC /* get both v4/v6 addrs */,
GAA_FLAG_INCLUDE_PREFIX,
NULL,
- paddrs,
+ reinterpret_cast<IP_ADAPTER_ADDRESSES*>(charbuf.data()),
&outbuflen);
if (ret == ERROR_BUFFER_OVERFLOW) {
charbuf.resize(outbuflen);
@@ -40,7 +39,7 @@ std::vector<InterfaceInfo> GetAllInterfaces() {
}
std::vector<InterfaceInfo> infos;
- auto pcurraddrs = paddrs;
+ auto pcurraddrs = reinterpret_cast<IP_ADAPTER_ADDRESSES*>(charbuf.data());
while (pcurraddrs != nullptr) {
// TODO: return the interfaces
OSP_DVLOG << "\tIfIndex=" << pcurraddrs->IfIndex;