From: Selva Nair Date: Mon, 14 Sep 2020 23:29:41 +0000 (-0400) Subject: Allow --dhcp-option in config file when windows-driver is wintun X-Git-Tag: v2.5_rc1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fe13491de31fff127bdceb6026fc05732f7dfb3;p=thirdparty%2Fopenvpn.git Allow --dhcp-option in config file when windows-driver is wintun When wintun is in use we mutate ip_win32_type to NETSH and then complain that ip-win32 option should be dynamic or adaptive if any --dhcp-option directive is present in the config file. This causes a fatal error. How to reproduce: specify a --dhcp-option in the config and change the --windows-driver to wintun. Fix this behaviour. A typo in the message is also corrected. Signed-off-by: Selva Nair Acked-by: Lev Stipakov Message-Id: <1600126181-16364-1-git-send-email-selva.nair@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21005.html Signed-off-by: Gert Doering (cherry picked from commit b8625abbd5be21a810b648058e6e411a7ff19702) --- diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 8bf82c57d..4b22d3d93 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -2181,10 +2181,11 @@ options_postprocess_verify_ce(const struct options *options, const struct connec } if (options->tuntap_options.dhcp_options + && options->windows_driver != WINDOWS_DRIVER_WINTUN && options->tuntap_options.ip_win32_type != IPW32_SET_DHCP_MASQ && options->tuntap_options.ip_win32_type != IPW32_SET_ADAPTIVE) { - msg(M_USAGE, "--dhcp-options requires --ip-win32 dynamic or adaptive"); + msg(M_USAGE, "--dhcp-option requires --ip-win32 dynamic or adaptive"); } if (options->windows_driver == WINDOWS_DRIVER_WINTUN && dev != DEV_TYPE_TUN)