DEV9: Skip over invalid gateways

This commit is contained in:
TheLastRar 2024-11-19 19:02:46 +00:00
parent 53048f243f
commit 6307c630b7
1 changed files with 2 additions and 1 deletions

View File

@ -384,6 +384,7 @@ std::vector<IP_Address> AdapterUtils::GetGateways(const Adapter* adapter)
if (ReadAddressFamily(address->Address.lpSockaddr) == AF_INET)
{
const sockaddr_in* sockaddr = reinterpret_cast<sockaddr_in*>(address->Address.lpSockaddr);
if (sockaddr->sin_addr.S_un.S_addr != 0)
collection.push_back(std::bit_cast<IP_Address>(sockaddr->sin_addr));
}
address = address->Next;