[AFD] Respect the maximum receive buffer size for datagram sockets. CORE-14048 181/head
authorThomas Faber <thomas.faber@reactos.org>
Mon, 4 Dec 2017 20:13:43 +0000 (21:13 +0100)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 10 Jun 2018 11:00:37 +0000 (13:00 +0200)
drivers/network/afd/afd/bind.c
drivers/network/afd/afd/read.c

index 1962d22..5d8e197 100644 (file)
@@ -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,
index b0ff01a..e786faa 100644 (file)
@@ -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,