mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-12-25 09:39:52 +03:00
Improving the compliance of Virtual Network Adapters with the local address bit of the MAC address rule.
When installing a new device driver of the Virtual Network Driver card, we changed the initial random MAC address from 00-AC-xx-xx-xx-xx to 5E-xx-xx-xx-xx-xx. This realizes the compliance with the local address bit of the MAC address rule.
This commit is contained in:
parent
b1f74268b1
commit
683aecaaec
@ -431,7 +431,7 @@ void CiChangeAllVLanMacAddress(CLIENT *c)
|
||||
RPC_CLIENT_ENUM_VLAN_ITEM *e = t.Items[i];
|
||||
UCHAR mac[6];
|
||||
|
||||
if (StrToMac(mac, e->MacAddress) && mac[1] == 0xAC)
|
||||
if (StrToMac(mac, e->MacAddress) && ((mac[0] == 0x00 && mac[1] == 0xAC) || (mac[0] = 0x5E)))
|
||||
{
|
||||
char *name = e->DeviceName;
|
||||
RPC_CLIENT_SET_VLAN s;
|
||||
|
@ -10306,12 +10306,12 @@ void GenMacAddress(UCHAR *mac)
|
||||
Hash(hash, b->Buf, b->Size, true);
|
||||
|
||||
// Generate a MAC address
|
||||
mac[0] = 0x00;
|
||||
mac[1] = 0xAC; // AC hurray
|
||||
mac[2] = hash[0];
|
||||
mac[3] = hash[1];
|
||||
mac[4] = hash[2];
|
||||
mac[5] = hash[3];
|
||||
mac[0] = 0x5E;
|
||||
mac[1] = hash[0];
|
||||
mac[2] = hash[1];
|
||||
mac[3] = hash[2];
|
||||
mac[4] = hash[3];
|
||||
mac[5] = hash[4];
|
||||
|
||||
FreeBuf(b);
|
||||
}
|
||||
|
@ -10509,12 +10509,12 @@ void MsGenMacAddress(UCHAR *mac)
|
||||
|
||||
Hash(hash, hash_src, sizeof(hash_src), true);
|
||||
|
||||
mac[0] = 0x00;
|
||||
mac[1] = 0xAC;
|
||||
mac[2] = hash[0];
|
||||
mac[3] = hash[1];
|
||||
mac[4] = hash[2];
|
||||
mac[5] = hash[3];
|
||||
mac[0] = 0x5E;
|
||||
mac[1] = hash[0];
|
||||
mac[2] = hash[1];
|
||||
mac[3] = hash[2];
|
||||
mac[4] = hash[3];
|
||||
mac[5] = hash[4];
|
||||
}
|
||||
|
||||
// Finish the driver installation
|
||||
|
Loading…
Reference in New Issue
Block a user