|
|
|
@ -399,7 +399,7 @@ tuntap_sys_set_ipv4(struct device *dev, t_tun_in_addr *s, uint32_t mask)
|
|
|
|
|
dns.length = 4;
|
|
|
|
|
dns.value[0] =
|
|
|
|
|
htonl(0x7F000001); /* apparently this doesn't show in network properties,
|
|
|
|
|
but it works 🤷🏻♂️ */
|
|
|
|
|
but it works */
|
|
|
|
|
dns.value[1] = 0;
|
|
|
|
|
|
|
|
|
|
ret = DeviceIoControl(dev->tun_fd, TAP_IOCTL_CONFIG_DHCP_SET_OPT, &dns,
|
|
|
|
@ -431,7 +431,7 @@ tuntap_read(struct device *dev, void *buf, size_t size)
|
|
|
|
|
{
|
|
|
|
|
DWORD x;
|
|
|
|
|
BOOL r;
|
|
|
|
|
_doserrno = 0;
|
|
|
|
|
int e = 0;
|
|
|
|
|
struct asio_evt_pkt *pkt = getTunEventPkt();
|
|
|
|
|
pkt->write = FALSE;
|
|
|
|
|
pkt->sz = size;
|
|
|
|
@ -440,8 +440,8 @@ tuntap_read(struct device *dev, void *buf, size_t size)
|
|
|
|
|
r = ReadFile(dev->tun_fd, buf, (DWORD)size, &x, &pkt->pkt);
|
|
|
|
|
if(r)
|
|
|
|
|
return x;
|
|
|
|
|
|
|
|
|
|
if(_doserrno && _doserrno != 997)
|
|
|
|
|
e = GetLastError();
|
|
|
|
|
if(e && e != 997)
|
|
|
|
|
{
|
|
|
|
|
tuntap_log(TUNTAP_LOG_ERR,
|
|
|
|
|
(const char *)formated_error(L"%1%0", _doserrno));
|
|
|
|
@ -449,8 +449,8 @@ tuntap_read(struct device *dev, void *buf, size_t size)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return size;
|
|
|
|
|
return -1; // unreachable
|
|
|
|
|
return -1; // unreachable
|
|
|
|
|
return size;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
@ -522,4 +522,4 @@ tuntap_set_ifname(struct device *dev, const char *name)
|
|
|
|
|
tuntap_log(TUNTAP_LOG_NOTICE,
|
|
|
|
|
"Your system does not support tuntap_set_ifname()");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|