]> git.proxmox.com Git - mirror_edk2.git/commitdiff
enhanced to support more routing table entry.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 20 May 2009 08:12:25 +0000 (08:12 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 20 May 2009 08:12:25 +0000 (08:12 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8342 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/DxeNetLib/DxeNetLib.c

index 59da12ce9140606aa0004f3dee379f796b780e5b..98cfc509cd8a6728066cccc83368811682d82883 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Network library.\r
   \r
 /** @file\r
   Network library.\r
   \r
-Copyright (c) 2005 - 2007, Intel Corporation.<BR>\r
+Copyright (c) 2005 - 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\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\r
@@ -37,7 +37,7 @@ EFI_DPC_PROTOCOL *mDpc = NULL;
 \r
 GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 mNetLibHexStr[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};\r
 \r
 \r
 GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 mNetLibHexStr[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};\r
 \r
-#define NIC_ITEM_CONFIG_SIZE   sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * 2\r
+#define NIC_ITEM_CONFIG_SIZE   sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * MAX_IP4_CONFIG_IN_VARIABLE\r
 \r
 //\r
 // All the supported IP4 maskes in host byte order.\r
 \r
 //\r
 // All the supported IP4 maskes in host byte order.\r
@@ -1287,7 +1287,7 @@ NetLibDefaultAddressIsStatic (
   ConfigHdr = HiiConstructConfigHdr (&gEfiNicIp4ConfigVariableGuid, EFI_NIC_IP4_CONFIG_VARIABLE, Controller);\r
   \r
   Len = StrLen (ConfigHdr);\r
   ConfigHdr = HiiConstructConfigHdr (&gEfiNicIp4ConfigVariableGuid, EFI_NIC_IP4_CONFIG_VARIABLE, Controller);\r
   \r
   Len = StrLen (ConfigHdr);\r
-  ConfigResp = AllocateZeroPool (Len + NIC_ITEM_CONFIG_SIZE * 2 + 200);\r
+  ConfigResp = AllocateZeroPool ((Len + NIC_ITEM_CONFIG_SIZE * 2 + 100) * sizeof (CHAR16));\r
   if (ConfigResp == NULL) {\r
     goto ON_EXIT;\r
   }\r
   if (ConfigResp == NULL) {\r
     goto ON_EXIT;\r
   }\r
@@ -1296,7 +1296,7 @@ NetLibDefaultAddressIsStatic (
   String = ConfigResp + Len;\r
   UnicodeSPrint (\r
     String, \r
   String = ConfigResp + Len;\r
   UnicodeSPrint (\r
     String, \r
-    (8 + 4 + 7 + 4) * sizeof (CHAR16), \r
+    (8 + 4 + 7 + 4 + 1) * sizeof (CHAR16), \r
     L"&OFFSET=%04X&WIDTH=%04X", \r
     OFFSET_OF (NIC_IP4_CONFIG_INFO, Source), \r
     sizeof (UINT32)\r
     L"&OFFSET=%04X&WIDTH=%04X", \r
     OFFSET_OF (NIC_IP4_CONFIG_INFO, Source), \r
     sizeof (UINT32)\r
@@ -1312,7 +1312,7 @@ NetLibDefaultAddressIsStatic (
     goto ON_EXIT;\r
   }\r
 \r
     goto ON_EXIT;\r
   }\r
 \r
-  ConfigInfo = AllocateZeroPool (sizeof (NIC_IP4_CONFIG_INFO));\r
+  ConfigInfo = AllocateZeroPool (sizeof (NIC_ITEM_CONFIG_SIZE));\r
   if (ConfigInfo == NULL) {\r
     goto ON_EXIT;\r
   }\r
   if (ConfigInfo == NULL) {\r
     goto ON_EXIT;\r
   }\r