diff options
author | hhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-07-01 09:08:33 +0000 |
---|---|---|
committer | hhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-07-01 09:08:33 +0000 |
commit | 49fd66cbf8144802976b727fcb541a185f73daf3 (patch) | |
tree | 661d5c349a4febc91fa6201bcef227d202ed9624 | |
parent | 7f97c9bb52c5938f841c396b60a41f05eba8640c (diff) | |
download | edk2-platforms-49fd66cbf8144802976b727fcb541a185f73daf3.tar.xz |
Fix a bug that mtftp4 driver reply 2 ACK in answer to incoming No.65535 block data. That issue incurs incorrect network transfer.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10619 6f19259b-4bc3-4df7-8a09-765794883524
4 files changed, 7 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c index c574f315df..264598f49a 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c @@ -169,7 +169,7 @@ Mtftp4RrqSaveBlock ( // to accept transfers of unlimited size. So TotalBlock is memorised as
// continuous block counter.
//
- Status = Mtftp4RemoveBlockNum (&Instance->Blocks, Block, &TotalBlock);
+ Status = Mtftp4RemoveBlockNum (&Instance->Blocks, Block, Completed, &TotalBlock);
if (Status == EFI_NOT_FOUND) {
return EFI_SUCCESS;
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c index 4dcdf827ea..bb4ce0ae65 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c @@ -158,6 +158,7 @@ Mtftp4SetLastBlockNum ( @param Head The block range list to remove from
@param Num The block number to remove
+ @param Completed Whether Num is the last block number
@param TotalBlock The continuous block number in all
@retval EFI_NOT_FOUND The block number isn't in the block range list
@@ -169,6 +170,7 @@ EFI_STATUS Mtftp4RemoveBlockNum (
IN LIST_ENTRY *Head,
IN UINT16 Num,
+ IN BOOLEAN Completed,
OUT UINT64 *TotalBlock
)
{
@@ -229,7 +231,7 @@ Mtftp4RemoveBlockNum ( Range->Round ++;
}
- if (Range->Start > Range->End) {
+ if ((Range->Start > Range->End) || Completed) {
RemoveEntryList (&Range->Link);
FreePool (Range);
}
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.h b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.h index 7a712a1a6d..802e3867db 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.h +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.h @@ -92,6 +92,7 @@ Mtftp4SetLastBlockNum ( @param Head The block range list to remove from
@param Num The block number to remove
+ @param Completed Wether Num is the last block number
@param TotalBlock The continuous block number in all
@retval EFI_NOT_FOUND The block number isn't in the block range list
@@ -103,6 +104,7 @@ EFI_STATUS Mtftp4RemoveBlockNum (
IN LIST_ENTRY *Head,
IN UINT16 Num,
+ IN BOOLEAN Completed,
OUT UINT64 *TotalBlock
);
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c index 4312e18c6f..412c472e42 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c @@ -166,7 +166,7 @@ Mtftp4WrqHandleAck ( // tell the Mtftp4WrqInput to finish the transfer. This is the last
// block number if the block range are empty..
//
- Mtftp4RemoveBlockNum (&Instance->Blocks, AckNum, &TotalBlock);
+ Mtftp4RemoveBlockNum (&Instance->Blocks, AckNum, *Completed,&TotalBlock);
Expected = Mtftp4GetNextBlockNum (&Instance->Blocks);
|