mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-10 03:30:39 +03:00
Generate DHCP Client ID based on MAC all the time
This commit is contained in:
parent
b41c17f45a
commit
1fe863e866
@ -1077,8 +1077,14 @@ BUF *IPCBuildDhcpRequestOptions(IPC *ipc, DHCP_OPTION_LIST *opt)
|
|||||||
// Hostname
|
// Hostname
|
||||||
if (IsEmptyStr(opt->Hostname) == false)
|
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_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
|
else // Client MAC Address
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user