1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-08 00:34:57 +03:00

Fix 'RemoveDefGwOnDhcpForLocalhost' function: Change to exclude unplugged device from MAC address list.

This commit is contained in:
hiura
2024-03-31 23:07:16 +09:00
parent e8c14cba68
commit 97203568e7
3 changed files with 9 additions and 0 deletions

View File

@ -540,6 +540,13 @@ LIST *Win32GetNicList()
if (a->Type == 6 && a->AddressSize == 6)
{
// If the connection state of the interface is unknown, then exclude it.
// Unknown means that the device is not plugged into the local host.
if (a->MediaConnectState == MediaConnectStateUnknown)
{
continue;
}
NIC_ENTRY *e = ZeroMalloc(sizeof(NIC_ENTRY));
StrCpy(e->IfName, sizeof(e->IfName), a->Title);