]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Allow --dhcp-option in config file when windows-driver is wintun
authorSelva Nair <selva.nair@gmail.com>
Mon, 14 Sep 2020 23:29:41 +0000 (19:29 -0400)
committerGert Doering <gert@greenie.muc.de>
Tue, 15 Sep 2020 07:00:58 +0000 (09:00 +0200)
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 <selva.nair@gmail.com>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
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 <gert@greenie.muc.de>
src/openvpn/options.c

index 8bf82c57d906e23cee6c778c40e6d99bf4a2d473..4b22d3d9348d8fa843af5f2e1e1cc2e0d69c565d 100644 (file)
@@ -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)