Wintun adapter becomes unresponsive or goes into bad state after sending traffic for sometime
Indira Priyadarshini Thangella
indira at versa-networks.com
Thu Feb 29 10:51:12 UTC 2024
Hi All,
I'm trying to setup a SSL-TLS based VPN connection. I'm using wintun and able to setup VPN connection and the tunnel comes up fine with my local server within a controlled environment. After the connection is up for sometime and after couple of speedtests(using Ookla), I'm running into a weird issue where I don't see wintunreceive events. It looks like adapter is not able to receive any packets from tunnel interface. At the same time, packets coming from server are not able to be sent to the wintun adapter using WintunSendPacket. Ping requests throw general failures once we hit this issue.
I've two threads one for processing wintun rx packets and the other for wintun tx packets. As I mentioned, I don't see any wintun rx data processing after speedtest. Just to mention, it happens randomly. Sometimes, I hit issue, during the first speedtest itself and sometimes after couple of speedtests but I'm seeing this very often.
Below is a snippet of my wintun tx packet thread handling. Once I hit the issue, I'm constantly hitting else condition where I reset the tun tx event.
HANDLE WaitHandles[] = { sslvpn_inst->tun_tx_event,
sslvpn_inst->wintun_tx_thr_term_ev };
while (1) {
event_result = WaitForMultipleObjects(_countof(WaitHandles), WaitHandles,
FALSE, INFINITE);
switch (event_result) {
case WAIT_OBJECT_0:
if (vs_sslvpn_recv_crit_itc_message(&sslvpn_inst->tun_tx_queue,
&packet, &packet_len) == 0) {
tun_packet = packet;
if (tun_packet != NULL) {
LogVerboseW(__VNFUNCTION__, __VNLINE__, L"VS-SSL> Sending packet to Wintun");
WintunSendPacket(sslvpn_wintun_clnt->session_handle, tun_packet);
}
}
else {
LogVerboseW(__VNFUNCTION__, __VNLINE__, L"VS-SSL> Failed to receive crit_itc_msg. Reset Event handle 0");
ResetEvent(WaitHandles[0]);
}
break;
Did anyone run into this issue? I typically see General failure errors with ping requests once I run into this issue.
However, the ipconfig still shows up the adapter but it just seems like the adapter went into a bad state. Once, I tear down the connection and set it up again, it works again for sometime but eventually run into same issue again! Any help or pointers is appreciated. Let me know if the above information is insufficient to understand the problem I'm trying to explain here.
More information about the WireGuard
mailing list