]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c
Fix a bug that mtftp4 driver reply 2 ACK in answer to incoming No.65535 block data...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Mtftp4Dxe / Mtftp4Support.c
index 4dcdf827ea57deb3b287574590f495a6e9586f45..bb4ce0ae65f9a25e50dd38844af1ee0aa5ae0e1d 100644 (file)
@@ -158,6 +158,7 @@ Mtftp4SetLastBlockNum (
 \r
   @param  Head                  The block range list to remove from\r
   @param  Num                   The block number to remove\r
+  @param  Completed             Whether Num is the last block number\r
   @param  TotalBlock            The continuous block number in all \r
 \r
   @retval EFI_NOT_FOUND         The block number isn't in the block range list\r
@@ -169,6 +170,7 @@ EFI_STATUS
 Mtftp4RemoveBlockNum (\r
   IN LIST_ENTRY             *Head,\r
   IN UINT16                 Num,\r
+  IN BOOLEAN                Completed,\r
   OUT UINT64                *TotalBlock\r
   )\r
 {\r
@@ -229,7 +231,7 @@ Mtftp4RemoveBlockNum (
                  Range->Round ++;\r
       }\r
 \r
-      if (Range->Start > Range->End) {\r
+      if ((Range->Start > Range->End) || Completed) {\r
         RemoveEntryList (&Range->Link);\r
         FreePool (Range);\r
       }\r