1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-20 06:30:42 +03:00

Cedar: DHCP server now assigns static IPv4 address, if present in user note

This works for all VPN protocols.

In SessionMain(): for DHCPDISCOVER and DHCPREQUEST frames, write the static IP address (which is retrieved from the user notes) in the SIADDR field of DHCPHEADER.

In VirtualDhcpServer(): for DHCPDISCOVER and DHCPREQUEST frames, read the static IP address from the SIADDR field of DHCPHEADER and assign it to the client.
This commit is contained in:
PeTeeR
2020-10-12 04:56:30 +02:00
committed by Davide Beatrici
parent 1c4b257a1b
commit b890c7d813
6 changed files with 240 additions and 10 deletions

View File

@ -9,6 +9,7 @@
#define ACCOUNT_H
#define USER_MAC_STR_PREFIX L"MAC:"
#define USER_IPV4_STR_PREFIX L"IPv4:"
// Policy item
struct POLICY_ITEM
@ -205,7 +206,6 @@ POLICY_ITEM *GetPolicyItem(UINT id);
void GetPolicyValueRangeStr(wchar_t *str, UINT size, UINT id);
void FormatPolicyValue(wchar_t *str, UINT size, UINT id, UINT value);
bool GetUserMacAddressFromUserNote(UCHAR *mac, wchar_t *note);
UINT GetUserIPv4AddressFromUserNote32(wchar_t *note);
#endif // ACCOUNT_H