}
#ifdef _WIN32
+ /* when using wintun, kernel doesn't send DHCP requests, so use netsh to set IP address and netmask */
+ if (options->wintun)
+ {
+ options->tuntap_options.ip_win32_type = IPW32_SET_NETSH;
+ }
+
if ((dev == DEV_TYPE_TUN || dev == DEV_TYPE_TAP) && !options->route_delay_defined)
{
- if (options->mode == MODE_POINT_TO_POINT)
+ /* delay may only be necessary when we perform DHCP handshake */
+ const bool dhcp = (options->tuntap_options.ip_win32_type == IPW32_SET_DHCP_MASQ)
+ || (options->tuntap_options.ip_win32_type == IPW32_SET_ADAPTIVE);
+ if ((options->mode == MODE_POINT_TO_POINT) && dhcp)
{
options->route_delay_defined = true;
options->route_delay = 5; /* Vista sometimes has a race without this */
options->ifconfig_noexec = false;
}
- /* for wintun kernel doesn't send DHCP requests, so use netsh to set IP address and netmask */
- if (options->wintun)
- {
- options->tuntap_options.ip_win32_type = IPW32_SET_NETSH;
- }
-
remap_redirect_gateway_flags(options);
-#endif
+#endif /* ifdef _WIN32 */
#if P2MP_SERVER
/*