mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-09-25 20:59:20 +03:00
- Fixed the problem occurs when RPC messages between Cluster Members exceed 64Kbytes.
- Fixed the RADIUS PEAP client to use the standard TLS versioning. - Implementation of a function to fix the MAC address of L3 VPN protocol by entering e.g. "MAC: 112233445566" in the "Notes" field of the user information. - Implementation of a function to fix the virtual MAC address to be assigned to the L3 VPN client as a string attribute from RADIUS server when authentication.
This commit is contained in:
@ -1272,3 +1272,49 @@ int CompareUserName(void *p1, void *p2)
|
||||
return StrCmpi(u1->Name, u2->Name);
|
||||
}
|
||||
|
||||
// Get the MAC address from the user's note string
|
||||
bool GetUserMacAddressFromUserNote(UCHAR *mac, wchar_t *note)
|
||||
{
|
||||
bool ret = false;
|
||||
UINT i;
|
||||
|
||||
Zero(mac, 6);
|
||||
if (mac == NULL || note == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
i = UniSearchStrEx(note, USER_MAC_STR_PREFIX, 0, false);
|
||||
if (i != INFINITE)
|
||||
{
|
||||
wchar_t *macstr_start = ¬e[i + UniStrLen(USER_MAC_STR_PREFIX)];
|
||||
wchar_t macstr2[MAX_SIZE];
|
||||
UNI_TOKEN_LIST *tokens;
|
||||
|
||||
UniStrCpy(macstr2, sizeof(macstr2), macstr_start);
|
||||
|
||||
UniTrim(macstr2);
|
||||
|
||||
tokens = UniParseToken(macstr2, L" ,/()[].");
|
||||
if (tokens != NULL)
|
||||
{
|
||||
if (tokens->NumTokens >= 1)
|
||||
{
|
||||
wchar_t *macstr = tokens->Token[0];
|
||||
|
||||
if (UniIsEmptyStr(macstr) == false)
|
||||
{
|
||||
char macstr_a[MAX_SIZE];
|
||||
|
||||
UniToStr(macstr_a, sizeof(macstr_a), macstr);
|
||||
|
||||
ret = StrToMac(mac, macstr_a);
|
||||
}
|
||||
}
|
||||
|
||||
UniFreeToken(tokens);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user