summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-05-26 08:16:25 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-05-26 08:16:25 +0000
commit7659d0c92fb0edde36289ea738258464484204e4 (patch)
tree4049bb537031e16b215cf09c8005656aae4b22d4 /MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c
parentb96b676f111cb9d417575aeece3444a7dbd1d048 (diff)
downloadedk2-platforms-7659d0c92fb0edde36289ea738258464484204e4.tar.xz
[Description]:
Fixed one bug in PciBus. PciBus doesn't clear the bridges bus number for all the root bridges before scanning any of them. [Description]: The static IP configuration no long works in the EDK 1.04 network package. The cause is that changing the type of EFI_IP4_IPCONFIG_DATA.RouteTable from a variable length array to a pointer is not clean. If the whole structure is read from variable, the pointer is invalid. [Solution] Fix the pointer before using it [Impaction]: Ip4ConfigDxe module. [Reference Info]: EDK tracker 1134 - Static IP configuration no long works. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5291 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c')
-rw-r--r--MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c
index dabd13c1db..65c2f840aa 100644
--- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c
+++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -249,6 +249,7 @@ Ip4ConfigFindNicVariable (
}
CopyMem (Config, Cur, Len);
+ Ip4ConfigFixRouteTablePointer (&Config->Ip4Info);
return Config;
}
@@ -381,3 +382,20 @@ Ip4ConfigModifyVariable (
NewVar->CheckSum = (UINT16) (~NetblockChecksum ((UINT8 *) NewVar, TotalLen));
return NewVar;
}
+
+VOID
+Ip4ConfigFixRouteTablePointer (
+ IN EFI_IP4_IPCONFIG_DATA *ConfigData
+ )
+{
+ //
+ // The memory used for route table entries must immediately follow
+ // the ConfigData and be not packed.
+ //
+ if (ConfigData->RouteTableSize > 0) {
+ ConfigData->RouteTable = (EFI_IP4_ROUTE_TABLE *) (ConfigData + 1);
+ } else {
+ ConfigData->RouteTable = NULL;
+ }
+}
+