mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 09:29:52 +03:00
Fix 'RemoveDefGwOnDhcpForLocalhost' function: Change to exclude unplugged device from MAC address list.
This commit is contained in:
parent
e8c14cba68
commit
97203568e7
@ -2568,6 +2568,7 @@ MS_ADAPTER_LIST *MsCreateAdapterListInnerExVista(bool no_info)
|
||||
UniStrCpy(a->TitleW, sizeof(a->TitleW), title);
|
||||
UniToStr(a->Title, sizeof(a->Title), title);
|
||||
a->Index = r->InterfaceIndex;
|
||||
a->MediaConnectState = r->MediaConnectState;
|
||||
a->Type = r->Type;
|
||||
a->Status = ConvertMidStatusVistaToXp(r->OperStatus);
|
||||
a->Mtu = r->Mtu;
|
||||
|
@ -281,6 +281,7 @@ typedef struct MS_ADAPTER
|
||||
char Title[MAX_PATH]; // Display name
|
||||
wchar_t TitleW[MAX_PATH]; // Display Name (Unicode)
|
||||
UINT Index; // Index
|
||||
UINT MediaConnectState; // Media Connect State
|
||||
UINT Type; // Type
|
||||
UINT Status; // Status
|
||||
UINT Mtu; // MTU
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user