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
/** @file\r
\r
-Copyright (c) 2006 - 2007, 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
} else {\r
Status = EFI_SUCCESS;\r
CopyMem (NicConfig, Config, Len);\r
+ Ip4ConfigFixRouteTablePointer (&NicConfig->Ip4Info);\r
}\r
\r
*ConfigLen = Len;\r
//\r
if (Reconfig && (Instance->ReconfigEvent != NULL)) {\r
Status = gBS->SignalEvent (Instance->ReconfigEvent);\r
+ NetLibDispatchDpc ();\r
}\r
\r
return Status;\r
ON_EXIT:\r
gBS->RestoreTPL (OldTpl);\r
\r
+ NetLibDispatchDpc ();\r
+\r
return Status;\r
}\r
\r
Status = EFI_BUFFER_TOO_SMALL;\r
} else {\r
CopyMem (ConfigData, &NicConfig->Ip4Info, Len);\r
+ Ip4ConfigFixRouteTablePointer (ConfigData);\r
}\r
\r
*ConfigDataSize = Len;\r
ON_EXIT:\r
gBS->SignalEvent (Instance->DoneEvent);\r
Ip4ConfigCleanDhcp4 (Instance);\r
+\r
+ NetLibDispatchDpc ();\r
+\r
return ;\r
}\r
\r
/** @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
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
/** @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
#define SIZEOF_IP4_CONFIG_INFO(Ip4Config) \\r
(sizeof (EFI_IP4_IPCONFIG_DATA) + \\r
- sizeof (EFI_IP4_ROUTE_TABLE) * (MAX (1, (Ip4Config)->RouteTableSize) - 1))\r
+ sizeof (EFI_IP4_ROUTE_TABLE) * (Ip4Config)->RouteTableSize)\r
\r
#define SIZEOF_NIC_IP4_CONFIG_INFO(NicConfig) \\r
(sizeof (NIC_IP4_CONFIG_INFO) + \\r
- sizeof (EFI_IP4_ROUTE_TABLE) * (MAX (1, (NicConfig)->Ip4Info.RouteTableSize) - 1))\r
+ sizeof (EFI_IP4_ROUTE_TABLE) * (NicConfig)->Ip4Info.RouteTableSize)\r
\r
//\r
// Compare whether two NIC address are equal includes their type and length.\r
IN NIC_ADDR *NicAddr,\r
IN NIC_IP4_CONFIG_INFO *Config OPTIONAL\r
);\r
+\r
+VOID\r
+Ip4ConfigFixRouteTablePointer (\r
+ IN EFI_IP4_IPCONFIG_DATA *ConfigData\r
+ );\r
+\r
#endif\r