From 408665270fbbb36134b8221ab262deedb12ef755 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 2 Aug 2019 11:57:29 +0200 Subject: 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 --- wintun.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'wintun.c') diff --git a/wintun.c b/wintun.c index 3275cd8..f45f301 100644 --- a/wintun.c +++ b/wintun.c @@ -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; } -- cgit v1.2.3-59-g8ed1b