summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2015-08-06 05:45:32 +0000
committerjiaxinwu <jiaxinwu@Edk2>2015-08-06 05:45:32 +0000
commit3fd56a2672ede208e44d5bc495339bfb9ba6cd5d (patch)
tree55e583b8e88d8cc2a22de6cb3515274cbb5533eb /ShellPkg
parent5630cdfe9fcaf54f704be05f0311987bfcae4dc2 (diff)
downloadedk2-3fd56a2672ede208e44d5bc495339bfb9ba6cd5d.tar.gz
edk2-3fd56a2672ede208e44d5bc495339bfb9ba6cd5d.tar.bz2
edk2-3fd56a2672ede208e44d5bc495339bfb9ba6cd5d.zip
ShellPkg: Fix issue about ping fail with IPv4
Fix issue about ping fail with IPv4, which is caused by the incorrect checksum in request message. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18167 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
index 643be2304f..cc3c0c3db5 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
@@ -598,8 +598,7 @@ PingGenerateToken (
//
Request->Type = (UINT8)(Private->IpChoice==PING_IP_CHOICE_IP6?ICMP_V6_ECHO_REQUEST:ICMP_V4_ECHO_REQUEST);
Request->Code = 0;
- Request->SequenceNum = SequenceNum;
- Request->TimeStamp = TimeStamp;
+ Request->SequenceNum = SequenceNum;
Request->Identifier = 0;
Request->Checksum = 0;
@@ -607,6 +606,7 @@ PingGenerateToken (
// Assembly token for transmit.
//
if (Private->IpChoice==PING_IP_CHOICE_IP6) {
+ Request->TimeStamp = TimeStamp;
((EFI_IP6_TRANSMIT_DATA*)TxData)->ExtHdrsLength = 0;
((EFI_IP6_TRANSMIT_DATA*)TxData)->ExtHdrs = NULL;
((EFI_IP6_TRANSMIT_DATA*)TxData)->OverrideData = 0;
@@ -628,6 +628,7 @@ PingGenerateToken (
((EFI_IP4_TRANSMIT_DATA*)TxData)->DestinationAddress.Addr[3] = Private->DstAddress[3];
HeadSum = NetChecksum ((UINT8 *) Request, Private->BufferSize);
+ Request->TimeStamp = TimeStamp;
TempChecksum = NetChecksum ((UINT8 *) &Request->TimeStamp, sizeof (UINT64));
Request->Checksum = (UINT16)(~NetAddChecksum (HeadSum, TempChecksum));
}