1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-12-27 02:29:52 +03:00

Generate DHCP Client ID based on MAC all the time

This commit is contained in:
Evengard 2020-05-03 17:46:02 +03:00
parent b41c17f45a
commit 1fe863e866

View File

@ -1077,8 +1077,14 @@ BUF *IPCBuildDhcpRequestOptions(IPC *ipc, DHCP_OPTION_LIST *opt)
// Hostname
if (IsEmptyStr(opt->Hostname) == false)
{
UCHAR client_id[MAX_HOST_NAME_LEN + 32];
UCHAR macstr[30];
MacToStr(macstr, sizeof(macstr), ipc->MacAddress);
Format(client_id, sizeof(client_id), "%s/%s", opt->Hostname, macstr);
Add(o, NewDhcpOption(DHCP_ID_HOST_NAME, opt->Hostname, StrLen(opt->Hostname)));
Add(o, NewDhcpOption(DHCP_ID_CLIENT_ID, opt->Hostname, StrLen(opt->Hostname)));
Add(o, NewDhcpOption(DHCP_ID_CLIENT_ID, client_id, StrLen(client_id)));
}
else // Client MAC Address
{