Fix ping command issue in IP4 driver.
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Ouyang Qian <qian.ouyang@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14314 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -740,11 +740,24 @@ Ip4FreeInterface (
|
||||
//
|
||||
Ip4CancelFrames (Interface, EFI_ABORTED, Ip4CancelInstanceFrame, IpInstance);
|
||||
|
||||
if (--Interface->RefCnt > 0) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
//
|
||||
// Destroy the ARP instance if this is the last IP instance that
|
||||
// has the address.
|
||||
// Destroy the interface if this is the last IP instance that
|
||||
// has the address. Remove all the system transmitted packets
|
||||
// from this interface, cancel the receive request if there is
|
||||
// one, and destroy the ARP requests.
|
||||
//
|
||||
if (Interface->Arp != NULL && IsListEmpty (&Interface->IpInstances)) {
|
||||
Ip4CancelFrames (Interface, EFI_ABORTED, Ip4CancelInstanceFrame, NULL);
|
||||
Ip4CancelReceive (Interface);
|
||||
|
||||
ASSERT (IsListEmpty (&Interface->IpInstances));
|
||||
ASSERT (IsListEmpty (&Interface->ArpQues));
|
||||
ASSERT (IsListEmpty (&Interface->SentFrames));
|
||||
|
||||
if (Interface->Arp != NULL) {
|
||||
gBS->CloseProtocol (
|
||||
Interface->ArpHandle,
|
||||
&gEfiArpProtocolGuid,
|
||||
@@ -758,24 +771,7 @@ Ip4FreeInterface (
|
||||
&gEfiArpServiceBindingProtocolGuid,
|
||||
Interface->ArpHandle
|
||||
);
|
||||
Interface->Arp = NULL;
|
||||
}
|
||||
|
||||
if (--Interface->RefCnt > 0) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
//
|
||||
// Destroy the interface if it is not referenced by any IP instance (for common Interface)
|
||||
// or the IP service (for the DefaultInterface). Remove all the system transmitted packets
|
||||
// from this interface, cancel the receive request if there is one.
|
||||
//
|
||||
Ip4CancelFrames (Interface, EFI_ABORTED, Ip4CancelInstanceFrame, NULL);
|
||||
Ip4CancelReceive (Interface);
|
||||
|
||||
ASSERT (IsListEmpty (&Interface->IpInstances));
|
||||
ASSERT (IsListEmpty (&Interface->ArpQues));
|
||||
ASSERT (IsListEmpty (&Interface->SentFrames));
|
||||
|
||||
RemoveEntryList (&Interface->Link);
|
||||
FreePool (Interface);
|
||||
|
Reference in New Issue
Block a user