/** @file\r
\r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2008, Intel Corporation \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
\r
**/\r
\r
+#include <Uefi.h>\r
\r
#include <Library/NetLib.h>\r
#include <Library/DebugLib.h>\r
\r
\r
/**\r
- Read the ip4 configure variable from the EFI variable\r
+ Read the ip4 configure variable from the EFI variable.\r
\r
None\r
\r
**/\r
EFI_STATUS\r
Ip4ConfigWriteVariable (\r
- IN IP4_CONFIG_VARIABLE * Config OPTIONAL\r
+ IN IP4_CONFIG_VARIABLE *Config OPTIONAL\r
)\r
{\r
EFI_STATUS Status;\r
}\r
\r
CopyMem (Config, Cur, Len);\r
+ Ip4ConfigFixRouteTablePointer (&Config->Ip4Info);\r
return Config;\r
}\r
\r
NewVar->CheckSum = (UINT16) (~NetblockChecksum ((UINT8 *) NewVar, TotalLen));\r
return NewVar;\r
}\r
+\r
+VOID\r
+Ip4ConfigFixRouteTablePointer (\r
+ IN EFI_IP4_IPCONFIG_DATA *ConfigData\r
+ )\r
+{\r
+ //\r
+ // The memory used for route table entries must immediately follow \r
+ // the ConfigData and be not packed.\r
+ //\r
+ if (ConfigData->RouteTableSize > 0) {\r
+ ConfigData->RouteTable = (EFI_IP4_ROUTE_TABLE *) (ConfigData + 1);\r
+ } else {\r
+ ConfigData->RouteTable = NULL;\r
+ }\r
+}\r
+\r