Hi,

> While patch looks big and scary, there are no functional changes at all,
> just tossing code around.

Indeed this looks scary. This patch chops Windows version of open_tun() into
functions. Maybe, preserve functions in the original order to help diff pair
the changes next time. Took me more than an hour to follow old and new code
side by side and compare.

> -    /*
> -     * Preliminaries for setting TAP-Windows adapter TCP/IP
> -     * properties via --ip-win32 dynamic or --ip-win32 adaptive.
> -     */
> -    if (tt->did_ifconfig_setup)

The original version always ran this block of code. For Wintun adapters too.
Now, it is a part of tuntap_post_open() -> tuntap_set_ip_props() which is
invoked for TAP-Windows6 adapters only.
Since Wintun is always IPW32_SET_NETSH for the time being the
tuntap_set_ip_props() would always be noop for Wintun.

> +        msg(M_INFO, "Sleeping for %d seconds...", s);
> +        management_sleep(s);
> +    }
> +}

The original version always slept. For Wintun adapters too. Now, it is a
part of tuntap_post_open() -> tuntap_set_connected() which is invoked for
TAP-Windows6 adapters only. When adding IPW32_SET_IPAPI support for Wintun,
we shall add this pause back.

Those were just my observations this is a tiny bit more than just a
"refactor".

BTW, the patch reindents some parts of the code (looks like editor's
auto-format after copy&paste). The indenting will be fixed in my follow-up
uncrustify patch.

Acked-by: Simon Rozman <si...@rozman.si>

Regards,
Simon

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to