]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Better attempt at handling TAP-Windows tun setup
authorDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 23 Sep 2016 20:35:32 +0000 (21:35 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 23 Sep 2016 20:35:32 +0000 (21:35 +0100)
Just set the network and mask to all zeros. It means it'll do proxy ARP
for *everything* and we can configure them all as on-link routes.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
tun-win32.c

index 1df3e46afddc4baf70732921e1463386ce743ed2..b5f6f83cc6bd481a72ef2124e3fe411e875dd122 100644 (file)
@@ -195,13 +195,12 @@ static intptr_t open_tun(struct openconnect_info *vpninfo, char *guid, char *nam
                     data[0], data[1], data[2]);
 
        data[0] = inet_addr(vpninfo->ip_info.addr);
-       /* Always ensure the netmask is no smaller than /31. This isn't a
-        * sensible Ethernet netmask, but at least as far as the TAP-Windows
-        * driver is concerned, it does allow for the existence of *one* other
-        * host for which ARP replies can be faked, and which we can use as
-        * the "router". */
-       data[2] = inet_addr(vpninfo->ip_info.netmask) & 0xfeffffff;
-       data[1] = data[0] & data[2];
+       /* Set network and mask both to 0.0.0.0. It's not about routing;
+        * it just ensures that the TAP driver fakes ARP responses for
+        * *everything* we throw at it, and we can just configure them
+        * as on-link routes. */
+       data[1] = 0;
+       data[2] = 0;
 
        if (!DeviceIoControl(tun_fh, TAP_IOCTL_CONFIG_TUN,
                             data, sizeof(data), data, sizeof(data),