https://git.reactos.org/?p=reactos.git;a=commitdiff;h=05b4bd38338abce17ea3e…
commit 05b4bd38338abce17ea3e2b8484baad3984a44cd
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Mon Dec 4 21:13:43 2017 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sun Jun 10 13:00:37 2018 +0200
[AFD] Respect the maximum receive buffer size for datagram sockets. CORE-14048
---
drivers/network/afd/afd/bind.c | 2 +-
drivers/network/afd/afd/read.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/network/afd/afd/bind.c b/drivers/network/afd/afd/bind.c
index 1962d226fa..5d8e197308 100644
--- a/drivers/network/afd/afd/bind.c
+++ b/drivers/network/afd/afd/bind.c
@@ -51,7 +51,7 @@ NTSTATUS WarmSocketForBind( PAFD_FCB FCB, ULONG ShareType ) {
Status = STATUS_NO_MEMORY;
}
- if (NT_SUCCESS(Status))
+ if (NT_SUCCESS(Status) && FCB->Recv.Content < FCB->Recv.Size)
{
Status = TdiReceiveDatagram(&FCB->ReceiveIrp.InFlightRequest,
FCB->AddressFile.Object,
diff --git a/drivers/network/afd/afd/read.c b/drivers/network/afd/afd/read.c
index b0ff01add6..e786faa251 100644
--- a/drivers/network/afd/afd/read.c
+++ b/drivers/network/afd/afd/read.c
@@ -681,7 +681,7 @@ PacketSocketRecvComplete(
} else
FCB->PollState &= ~AFD_EVENT_RECEIVE;
- if( NT_SUCCESS(Irp->IoStatus.Status) ) {
+ if( NT_SUCCESS(Irp->IoStatus.Status) && FCB->Recv.Content <
FCB->Recv.Size ) {
/* Now relaunch the datagram request */
Status = TdiReceiveDatagram
( &FCB->ReceiveIrp.InFlightRequest,