Re: [Openvpn-devel] [PATCH applied] Re: wintun: implement opening wintun device
Hi, > What I do not really like is the inflation of the code with > > if (!tt->wintun) > > statements now. I think this should be refactored out into an > "open_tun_wintun()" and an "open_tun_tap_windows()" function, where > all the bits that are now inside an "if (!tt->wintun)" get their > own function with less if() and less nesting. > I agree. I have sent a (yet another) patch (https://patchwork.openvpn.net/patch/918/ ) which refactors open_tun() method, which now looks like this: tun_open_device(tt, dev_node, &device_guid); if (tt->wintun) { wintun_register_ring_buffer(tt); } else { tuntap_post_open(tt, device_guid); } Note that it requires 6 of 7 wintun patches to be merged. Alternatively I can rebase wintun 4/5/6 patches on top of this one. -- -Lev ___ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [PATCH applied] Re: wintun: implement opening wintun device
Your patch has been applied to the master branch. Since this introduces a new library requirement, I gave it a test run on my Ubuntu 16 / MinGW linux build system. "Builds fine". Have not run the result. I have not done anything resembling proper code review. Just basic "this is only changing _WIN32 code, and doesn't seem to do bad stuff with pointers". What I do not really like is the inflation of the code with if (!tt->wintun) statements now. I think this should be refactored out into an "open_tun_wintun()" and an "open_tun_tap_windows()" function, where all the bits that are now inside an "if (!tt->wintun)" get their own function with less if() and less nesting. commit e64b4a9e68bde3cb7d878d277878fb2805040e3e Author: Lev Stipakov Date: Thu Nov 7 19:45:25 2019 +0200 wintun: implement opening wintun device Signed-off-by: Lev Stipakov Acked-by: Simon Rozman Message-Id: <1573148729-27339-4-git-send-email-lstipa...@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19029.html Signed-off-by: Gert Doering -- kind regards, Gert Doering ___ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel