aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;