MdeModulePke/Mtftp4Dxe: Correct the total received and saved block number.

The block returned from Mtftp4RemoveBlockNum is not the total received and
saved block number if it works in passive (Slave) mode.

The issue was exposed by the EMS test.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
This commit is contained in:
Jiaxin Wu
2018-10-25 15:31:10 +08:00
parent 0cd6452503
commit 9202304c18
5 changed files with 27 additions and 17 deletions

View File

@@ -149,7 +149,7 @@ Mtftp4WrqHandleAck (
{
UINT16 AckNum;
INTN Expected;
UINT64 TotalBlock;
UINT64 BlockCounter;
*Completed = FALSE;
AckNum = NTOHS (Packet->Ack.Block[0]);
@@ -168,9 +168,9 @@ Mtftp4WrqHandleAck (
//
// Remove the acked block number, if this is the last block number,
// tell the Mtftp4WrqInput to finish the transfer. This is the last
// block number if the block range are empty..
// block number if the block range are empty.
//
Mtftp4RemoveBlockNum (&Instance->Blocks, AckNum, *Completed,&TotalBlock);
Mtftp4RemoveBlockNum (&Instance->Blocks, AckNum, *Completed, &BlockCounter);
Expected = Mtftp4GetNextBlockNum (&Instance->Blocks);