]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix a bug that mtftp4 driver reply 2 ACK in answer to incoming No.65535 block data...
authorhhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 1 Jul 2010 09:08:33 +0000 (09:08 +0000)
committerhhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 1 Jul 2010 09:08:33 +0000 (09:08 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10619 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c
MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c
MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.h
MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c

index c574f315dfefabc181d05dbb8f28dceeb5f2e997..264598f49a0c520113d95120982007d90e48bba8 100644 (file)
@@ -169,7 +169,7 @@ Mtftp4RrqSaveBlock (
   // to accept transfers of unlimited size. So TotalBlock is memorised as \r
   // continuous block counter.\r
   //\r
-  Status = Mtftp4RemoveBlockNum (&Instance->Blocks, Block, &TotalBlock);\r
+  Status = Mtftp4RemoveBlockNum (&Instance->Blocks, Block, Completed, &TotalBlock);\r
 \r
   if (Status == EFI_NOT_FOUND) {\r
     return EFI_SUCCESS;\r
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
index 7a712a1a6db17bca9b2dd8be218f0a9350ee31aa..802e3867db810472b32fd8c60da60bc1bd6042ea 100644 (file)
@@ -92,6 +92,7 @@ Mtftp4SetLastBlockNum (
 \r
   @param  Head                  The block range list to remove from\r
   @param  Num                   The block number to remove\r
+  @param  Completed             Wether 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
@@ -103,6 +104,7 @@ EFI_STATUS
 Mtftp4RemoveBlockNum (\r
   IN LIST_ENTRY             *Head,\r
   IN UINT16                 Num,\r
+  IN BOOLEAN                Completed,\r
   OUT UINT64                *TotalBlock\r
   );\r
 \r
index 4312e18c6f88dc64df25cccba82ac554d4e277c9..412c472e42e6c93878477d8a32c623ce8a5eb9da 100644 (file)
@@ -166,7 +166,7 @@ Mtftp4WrqHandleAck (
   // tell the Mtftp4WrqInput to finish the transfer. This is the last\r
   // block number if the block range are empty..\r
   //\r
-  Mtftp4RemoveBlockNum (&Instance->Blocks, AckNum, &TotalBlock);\r
+  Mtftp4RemoveBlockNum (&Instance->Blocks, AckNum, *Completed,&TotalBlock);\r
 \r
   Expected = Mtftp4GetNextBlockNum (&Instance->Blocks);\r
 \r