1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-12-02 16:21:32 +03:00

OpenVPN: hostname support

OpenVPN sends the default gateway's MAC address, if the option --push-peer-info is enabled.
It also sends the client's environment variables whose names start with "UV_".

This commit adds some lines of code in OvsBeginIPCAsyncConnectionIfEmpty(), in order to set the hostname to "UV_HOSTNAME"'s value, which is defined by the user on their device.
In case "UV_HOSTNAME" is not available, "IV_HWADDR"'s value (the default gateway's MAC address) is used instead.

OvsParseOptions() has been adapted into a new function called OvsParsePeerInfo(), in order to parse the peer info string.
This commit is contained in:
Davide Beatrici
2018-04-20 17:33:07 +02:00
parent 1e8cf1dc5d
commit 3ceee41d33
2 changed files with 55 additions and 0 deletions

View File

@ -362,6 +362,7 @@ BUF *OvsBuildKeyMethod2(OPENVPN_KEY_METHOD_2 *d);
void OvsWriteStringToBuf(BUF *b, char *str, UINT max_size);
LIST *OvsParseOptions(char *str);
LIST *OvsParsePeerInfo(char *str);
void OvsFreeOptions(LIST *o);
LIST *OvsNewOptions();
void OvsAddOption(LIST *o, char *key, char *value);