diff options
author | Jiaxin Wu <Jiaxin.wu@intel.com> | 2018-10-25 15:16:13 +0800 |
---|---|---|
committer | Jiaxin Wu <Jiaxin.wu@intel.com> | 2018-10-29 08:31:18 +0800 |
commit | 2f6693c283b54666def65e5e0d0b84e48b21cfef (patch) | |
tree | 952ac6b19caa7a9deeb2630c345b234ec49d4913 /NetworkPkg/Mtftp6Dxe/Mtftp6Support.c | |
parent | 9202304c180e811ab7b64ccf01fe11187969fe9b (diff) | |
download | edk2-2f6693c283b54666def65e5e0d0b84e48b21cfef.tar.gz edk2-2f6693c283b54666def65e5e0d0b84e48b21cfef.tar.bz2 edk2-2f6693c283b54666def65e5e0d0b84e48b21cfef.zip |
NetworkPkg/Mtftp6Dxe: Correct the total received and saved block number.
The block returned from Mtftp6RemoveBlockNum 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>
Diffstat (limited to 'NetworkPkg/Mtftp6Dxe/Mtftp6Support.c')
-rw-r--r-- | NetworkPkg/Mtftp6Dxe/Mtftp6Support.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/NetworkPkg/Mtftp6Dxe/Mtftp6Support.c b/NetworkPkg/Mtftp6Dxe/Mtftp6Support.c index 275272b89e..f03216afb7 100644 --- a/NetworkPkg/Mtftp6Dxe/Mtftp6Support.c +++ b/NetworkPkg/Mtftp6Dxe/Mtftp6Support.c @@ -158,8 +158,8 @@ Mtftp6SetLastBlockNum ( @param[in] Head The block range list to remove from.
@param[in] Num The block number to remove.
- @param[in] Completed Whether Num is the last block number
- @param[out] TotalBlock The continuous block number in all
+ @param[in] Completed Whether Num is the last block number.
+ @param[out] BlockCounter The continuous block counter instead of the value after roll-over.
@retval EFI_NOT_FOUND The block number isn't in the block range list.
@retval EFI_SUCCESS The block number has been removed from the list.
@@ -171,7 +171,7 @@ Mtftp6RemoveBlockNum ( IN LIST_ENTRY *Head,
IN UINT16 Num,
IN BOOLEAN Completed,
- OUT UINT64 *TotalBlock
+ OUT UINT64 *BlockCounter
)
{
MTFTP6_BLOCK_RANGE *Range;
@@ -220,10 +220,10 @@ Mtftp6RemoveBlockNum ( // wrap to zero, because this is the simplest to implement. Here we choose
// this solution.
//
- *TotalBlock = Num;
+ *BlockCounter = Num;
if (Range->Round > 0) {
- *TotalBlock += Range->Bound + MultU64x32 (Range->Round - 1, (UINT32)(Range->Bound + 1)) + 1;
+ *BlockCounter += Range->Bound + MultU64x32 (Range->Round - 1, (UINT32)(Range->Bound + 1)) + 1;
}
if (Range->Start > Range->Bound) {
|