data[0], data[1], data[2]);
data[0] = inet_addr(vpninfo->ip_info.addr);
- data[2] = inet_addr(vpninfo->ip_info.netmask);
+ /* 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];
if (!DeviceIoControl(tun_fh, TAP_IOCTL_CONFIG_TUN,