From d624deb7abf9ddce2a3a280eec233f5c5feb4f20 Mon Sep 17 00:00:00 2001 From: Meenakshi Aggarwal Date: Fri, 16 Feb 2018 14:15:11 +0530 Subject: [PATCH] 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 --- ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.39.2