/** @file\r
The implementation of the ARP protocol.\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation.<BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation.<BR>\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at<BR>\r
Packet = AllocatePool (TotalLength);\r
if (Packet == NULL) {\r
DEBUG ((EFI_D_ERROR, "ArpSendFrame: Allocate memory for Packet failed.\n"));\r
+ ASSERT (Packet != NULL);\r
}\r
\r
TmpPtr = Packet;\r
UINT32 FoundCount;\r
EFI_ARP_FIND_DATA *FindData;\r
LIST_ENTRY *CacheTable;\r
+ UINT32 FoundEntryLength;\r
\r
ArpService = Instance->ArpService;\r
\r
goto CLEAN_EXIT;\r
}\r
\r
+ //\r
+ // Found the entry length, make sure its 8 bytes alignment.\r
+ //\r
+ FoundEntryLength = (((sizeof (EFI_ARP_FIND_DATA) + Instance->ConfigData.SwAddressLength +\r
+ ArpService->SnpMode.HwAddressSize) + 3) & ~(0x3));\r
+\r
if (EntryLength != NULL) {\r
- //\r
- // Return the entry length, make sure its 8 bytes alignment.\r
- //\r
- *EntryLength = (((sizeof (EFI_ARP_FIND_DATA) + Instance->ConfigData.SwAddressLength +\r
- ArpService->SnpMode.HwAddressSize) + 3) & ~(0x3));\r
+ *EntryLength = FoundEntryLength;\r
}\r
\r
if (EntryCount != NULL) {\r
//\r
// Allocate buffer to copy the found entries.\r
//\r
- FindData = AllocatePool (FoundCount * (*EntryLength));\r
+ FindData = AllocatePool (FoundCount * FoundEntryLength);\r
if (FindData == NULL) {\r
DEBUG ((EFI_D_ERROR, "ArpFindCacheEntry: Failed to allocate memory.\n"));\r
Status = EFI_OUT_OF_RESOURCES;\r