REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4376

While shell is polling to send/receive ICMP packets, Private ->status is not 
updated for below scenario,
Considering 10 packets are transferred and it's RTT time is between 1764-1812 
ms .In this 10 packets 2 or 3 packets
are lost in between ping communication and reported timeout issue and last one 
is successful packet.
In this case failed packet is reported before the last successful packet hence 
,private ->status is not
updated with either success or EFI_TIMEOUT.
Counted Fail count of Ping communication ,when private->Txinfo list is empty 
and sum of failcount and receive
count equals to the total packets private->status has been updated to timeout.

Signed-off-by: Kanagavel S <kanagav...@ami.com>
---
 ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c 
b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
index e0b58d4b85..50d1bb6e1d 100644
--- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
+++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
@@ -2,6 +2,7 @@
   The implementation for Ping6 application.



   Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>

+  Copyright (c) 1985 - 2023, American Megatrends International LLC.<BR>



   SPDX-License-Identifier: BSD-2-Clause-Patent



@@ -92,7 +93,7 @@ SHELL_PARAM_ITEM  Ping6ParamList[] = {
 CONST CHAR16           *mIp6DstString;

 CONST CHAR16           *mIp6SrcString;

 EFI_CPU_ARCH_PROTOCOL  *Cpu = NULL;

-

+UINT32                  gFailCount = 0;

 /**

   RTT timer tick routine.



@@ -457,6 +458,9 @@ Ping6OnEchoReplyReceived6 (
 ON_EXIT:



   if (Private->RxCount < Private->SendNum) {

+      if (IsListEmpty (&Private->TxList) && ((Private->RxCount + gFailCount) 
== Private->SendNum)){

+          Private->Status = EFI_TIMEOUT;

+      }

     //

     // Continue to receive icmp6 echo reply packets.

     //

@@ -715,7 +719,7 @@ Ping6OnTimerRoutine6 (
       // Remove the timeout icmp6 echo request from list.

       //

       ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_TIMEOUT), 
gShellNetwork2HiiHandle, TxInfo->SequenceNum);

-

+      gFailCount++;

       RemoveEntryList (&TxInfo->Link);

       Ping6DestroyTxInfo (TxInfo);



@@ -1048,6 +1052,7 @@ ShellPing6 (
   SHELL_STATUS         ShellStatus;



   ShellStatus = SHELL_SUCCESS;

+  gFailCount = 0;

   Private     = AllocateZeroPool (sizeof (PING6_PRIVATE_DATA));



   if (Private == NULL) {

--
2.35.1.windows.2
-The information contained in this message may be confidential and proprietary 
to American Megatrends (AMI). This communication is intended to be read only by 
the individual or entity to whom it is addressed or by their designee. If the 
reader of this message is not the intended recipient, you are on notice that 
any distribution of this message, in any form, is strictly prohibited. Please 
promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and 
then delete or destroy all copies of the transmission.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102178): https://edk2.groups.io/g/devel/message/102178
Mute This Topic: https://groups.io/mt/97949969/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to