From: Meenakshi Aggarwal Date: Fri, 16 Feb 2018 08:45:11 +0000 (+0530) Subject: ShellPkg/Ping: fix loss of first packet X-Git-Tag: edk2-stable201903~2350 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=d624deb7abf9ddce2a3a280eec233f5c5feb4f20;ds=sidebyside ShellPkg/Ping: fix loss of first packet Issue: Reply for first ping packet was getting dropped. Cause: Sometimes reply message comes even before trasmit function returns, hence missing 1st reply Fix: Prepare the TxList before calling Transmit function. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Meenakshi Aggarwal Reviewed-by: Jaben Carsey Reviewed-by: Ruiyu Ni --- diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c index bec9535a8b..46ba701fc5 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c @@ -784,14 +784,17 @@ PingSendEchoRequest ( } ASSERT(Private->ProtocolPointers.Transmit != NULL); + + InsertTailList (&Private->TxList, &TxInfo->Link); + Status = Private->ProtocolPointers.Transmit (Private->IpProtocol, TxInfo->Token); if (EFI_ERROR (Status)) { + RemoveEntryList (&TxInfo->Link); PingDestroyTxInfo (TxInfo, Private->IpChoice); return Status; } - InsertTailList (&Private->TxList, &TxInfo->Link); Private->TxCount++; return EFI_SUCCESS;