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>
This commit is contained in:
parent
9d71da2d37
commit
408665270f
2
wintun.c
2
wintun.c
@ -503,6 +503,8 @@ TunProcessReceiveData(_Inout_ TUN_CTX *Ctx)
|
|||||||
if (!Nbl)
|
if (!Nbl)
|
||||||
{
|
{
|
||||||
InterlockedIncrement64((LONG64 *)&Ctx->Statistics.ifInDiscards);
|
InterlockedIncrement64((LONG64 *)&Ctx->Statistics.ifInDiscards);
|
||||||
|
KeWaitForSingleObject(&Ctx->Device.Receive.ActiveNbls.Empty, Executive, KernelMode, FALSE, NULL);
|
||||||
|
InterlockedSetU(&Ring->Head, RingHead);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user