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>
This commit is contained in:
Meenakshi Aggarwal 2018-02-16 14:15:11 +05:30 committed by Laszlo Ersek
parent 8aaa8f7bc0
commit d624deb7ab
1 changed files with 4 additions and 1 deletions

View File

@ -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;