diff options
author | Simon Rozman <simon@rozman.si> | 2019-08-02 11:57:29 +0200 |
---|---|---|
committer | Simon Rozman <simon@rozman.si> | 2019-08-02 12:04:02 +0200 |
commit | 408665270fbbb36134b8221ab262deedb12ef755 (patch) | |
tree | cc63596da8880789bd3cca35d3457185786ff5f9 | |
parent | Version bump (diff) | |
download | wintun-408665270fbbb36134b8221ab262deedb12ef755.tar.xz wintun-408665270fbbb36134b8221ab262deedb12ef755.zip |
Skip packet on NBL allocation failure properly
Should NBL allocation persist to fail, the receive ring could eventually
fill up as there will be no TunReturnNetBufferLists() calls to advance
its head.
Signed-off-by: Simon Rozman <simon@rozman.si>
-rw-r--r-- | wintun.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -503,6 +503,8 @@ TunProcessReceiveData(_Inout_ TUN_CTX *Ctx) if (!Nbl) { InterlockedIncrement64((LONG64 *)&Ctx->Statistics.ifInDiscards); + KeWaitForSingleObject(&Ctx->Device.Receive.ActiveNbls.Empty, Executive, KernelMode, FALSE, NULL); + InterlockedSetU(&Ring->Head, RingHead); continue; } |