Commit fea9d8f1 authored by Andrew Nguyen's avatar Andrew Nguyen Committed by Alexandre Julliard

iphlpapi: Remove useless loop and initialize gateway linked list next member to NULL.

parent 29a4da8c
......@@ -813,19 +813,9 @@ static ULONG adapterAddressesFromIndex(ULONG family, DWORD index, IP_ADAPTER_ADD
PIP_ADAPTER_GATEWAY_ADDRESS gw;
PSOCKADDR_IN sin;
for (gw = aa->FirstGatewayAddress; gw && gw->Next;
gw = gw->Next)
;
if (!gw)
{
gw = (PIP_ADAPTER_GATEWAY_ADDRESS)ptr;
aa->FirstGatewayAddress = gw;
}
else
{
gw->Next = (PIP_ADAPTER_GATEWAY_ADDRESS)ptr;
gw = gw->Next;
}
gw = (PIP_ADAPTER_GATEWAY_ADDRESS)ptr;
aa->FirstGatewayAddress = gw;
gw->u.s.Length = sizeof(IP_ADAPTER_GATEWAY_ADDRESS);
ptr += sizeof(IP_ADAPTER_GATEWAY_ADDRESS);
sin = (PSOCKADDR_IN)ptr;
......@@ -835,6 +825,7 @@ static ULONG adapterAddressesFromIndex(ULONG family, DWORD index, IP_ADAPTER_ADD
sizeof(DWORD));
gw->Address.lpSockaddr = (LPSOCKADDR)sin;
gw->Address.iSockaddrLength = sizeof(SOCKADDR_IN);
gw->Next = NULL;
ptr += sizeof(SOCKADDR_IN);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment