From: Lev Stipakov <l...@openvpn.net> Some pushed options (such as DOMAIN-SEARCH) require DHCP server to work. Warn user that some options will not work if the current driver (such as dco-win) doesn't support DHCP.
Change-Id: Ie512544329a91fae15409cb18f29d8be617051a1 Signed-off-by: Lev Stipakov <l...@openvpn.net> Acked-by: Frank Lichtenheld <fr...@lichtenheld.com> --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/428 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld <fr...@lichtenheld.com> diff --git a/src/openvpn/options.c b/src/openvpn/options.c index abd2e0c..b34e2f6 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -2477,10 +2477,10 @@ if (options->tuntap_options.dhcp_options & DHCP_OPTIONS_DHCP_REQUIRED) { - const char *prefix = "Some dhcp-options require DHCP server"; + const char *prefix = "Some --dhcp-option or --dns options require DHCP server"; if (options->windows_driver != WINDOWS_DRIVER_TAP_WINDOWS6) { - msg(M_USAGE, "%s, which is not supported by selected %s driver", + msg(M_USAGE, "%s, which is not supported by the selected %s driver", prefix, print_windows_driver(options->windows_driver)); } else if (options->tuntap_options.ip_win32_type != IPW32_SET_DHCP_MASQ diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index f857ed1..1b79d42 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6826,6 +6826,13 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt, openvpn_net_ctx_t *ctx) { + if ((tt->options.dhcp_options & DHCP_OPTIONS_DHCP_REQUIRED) + && tt->windows_driver != WINDOWS_DRIVER_TAP_WINDOWS6) + { + msg(M_WARN, "Some --dhcp-option or --dns options require DHCP server, which is not supported by the selected %s driver. They will be ignored.", + print_windows_driver(tt->windows_driver)); + } + /* dco-win already opened the device, which handle we treat as socket */ if (tuntap_is_dco_win(tt)) { _______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel