Hi,

On Tue, Jun 5, 2018 at 2:53 PM, Gert Doering <g...@greenie.muc.de> wrote:
> Hi,
>
> On Tue, Jun 05, 2018 at 01:30:35PM -0400, Selva Nair wrote:
>> How to work around that depends on what the tap driver expects in the
>> v4 address. Ideally, we should patch the driver to work without a V4
>> address...
>
> Samuli's build/test rig seems to be close to finished, so now is the
> time to break the tap driver for good ;-)
>
> I'll look into that.  Had my fingers in that code quite a lot recently
> anyway...
>

Sounds good.

FWIW, I did a quick test --- looking into tap-windows sources it seems
the address is used only for ARP so passing some random address to the
ioctl looks ok (?).

Tried this by commenting out the check for did_ifconfig_setup on when
windows tun mode is in use. In this case the local ip and netmask
stays at 0, and gets passed to tap-windows. This allows one to run
the exe on Windows (see the diff below to see what I did). Without
that it just errors out saying --dev tun requires ifconfig, as
expected.

There is a less than ideal log message which could be improved:

"Set TAP-Windows TUN subnet mode network/local/netmask =
0.0.0.0/0.0.0.0/0.0.0.0 [SUCCEEDED]"

However, even with !ipv4, redirect-gateway ipv6 appears to error out
-- it fails with

"TEST ROUTES: 0/2 succeeded len=1 ret=0 a=0 u/d=up
Route: Waiting for TUN/TAP interface to come up..."

A couple of other random things I noticed

If a v4 address is not being set:

- some management messages could be bypassed as Gert had guessed --
eg., ASSIGN_IP which includes the v4 and v6 address.
The GUI takes the address from the final CONNECTED,SUCCESS message but
other clients may parse this message.

- setting of mtu may get skipped in some systems at least

Here is the diff of what I did for the Windows build run:

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 2e33880..75336a9 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -5824,9 +5824,9 @@ open_tun(const char *dev, const char *dev_type,
const char *dev_node, struct tun

     if (tt->type == DEV_TYPE_TUN)
     {
-        if (!tt->did_ifconfig_setup)
+        if (!tt->did_ifconfig_setup && !tt->did_ifconfig_ipv6_setup)
         {
-            msg(M_FATAL, "ERROR: --dev tun also requires --ifconfig");
+            msg(M_WARN|M_INFO, "WARNING: neither ifconfig nor
ifconfig-ipv6 specified");
         }

         if (tt->topology == TOP_SUBNET)

Selva

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to