summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorMeenakshi Aggarwal <meenakshi.aggarwal@nxp.com>2018-02-16 14:15:11 +0530
committerLaszlo Ersek <lersek@redhat.com>2018-02-23 12:46:04 +0100
commitd624deb7abf9ddce2a3a280eec233f5c5feb4f20 (patch)
treee94a5f2c5789c0efb52f3663a561899a4a461813 /ShellPkg
parent8aaa8f7bc0f5dc79bce476e2ffa8a956c4db8bb0 (diff)
downloadedk2-d624deb7abf9ddce2a3a280eec233f5c5feb4f20.tar.gz
edk2-d624deb7abf9ddce2a3a280eec233f5c5feb4f20.tar.bz2
edk2-d624deb7abf9ddce2a3a280eec233f5c5feb4f20.zip
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 <meenakshi.aggarwal@nxp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c5
1 files changed, 4 insertions, 1 deletions
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;