mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
[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
This commit is contained in:
parent
b96b676f11
commit
7659d0c92f
@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -180,6 +180,7 @@ EfiNicIp4ConfigGetInfo (
|
|||||||
} else {
|
} else {
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
CopyMem (NicConfig, Config, Len);
|
CopyMem (NicConfig, Config, Len);
|
||||||
|
Ip4ConfigFixRouteTablePointer (&NicConfig->Ip4Info);
|
||||||
}
|
}
|
||||||
|
|
||||||
*ConfigLen = Len;
|
*ConfigLen = Len;
|
||||||
@ -272,6 +273,7 @@ EfiNicIp4ConfigSetInfo (
|
|||||||
//
|
//
|
||||||
if (Reconfig && (Instance->ReconfigEvent != NULL)) {
|
if (Reconfig && (Instance->ReconfigEvent != NULL)) {
|
||||||
Status = gBS->SignalEvent (Instance->ReconfigEvent);
|
Status = gBS->SignalEvent (Instance->ReconfigEvent);
|
||||||
|
NetLibDispatchDpc ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
@ -442,6 +444,8 @@ ON_ERROR:
|
|||||||
ON_EXIT:
|
ON_EXIT:
|
||||||
gBS->RestoreTPL (OldTpl);
|
gBS->RestoreTPL (OldTpl);
|
||||||
|
|
||||||
|
NetLibDispatchDpc ();
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -555,6 +559,7 @@ EfiIp4ConfigGetData (
|
|||||||
Status = EFI_BUFFER_TOO_SMALL;
|
Status = EFI_BUFFER_TOO_SMALL;
|
||||||
} else {
|
} else {
|
||||||
CopyMem (ConfigData, &NicConfig->Ip4Info, Len);
|
CopyMem (ConfigData, &NicConfig->Ip4Info, Len);
|
||||||
|
Ip4ConfigFixRouteTablePointer (ConfigData);
|
||||||
}
|
}
|
||||||
|
|
||||||
*ConfigDataSize = Len;
|
*ConfigDataSize = Len;
|
||||||
@ -676,6 +681,9 @@ Ip4ConfigOnDhcp4Complete (
|
|||||||
ON_EXIT:
|
ON_EXIT:
|
||||||
gBS->SignalEvent (Instance->DoneEvent);
|
gBS->SignalEvent (Instance->DoneEvent);
|
||||||
Ip4ConfigCleanDhcp4 (Instance);
|
Ip4ConfigCleanDhcp4 (Instance);
|
||||||
|
|
||||||
|
NetLibDispatchDpc ();
|
||||||
|
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -249,6 +249,7 @@ Ip4ConfigFindNicVariable (
|
|||||||
}
|
}
|
||||||
|
|
||||||
CopyMem (Config, Cur, Len);
|
CopyMem (Config, Cur, Len);
|
||||||
|
Ip4ConfigFixRouteTablePointer (&Config->Ip4Info);
|
||||||
return Config;
|
return Config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,3 +382,20 @@ Ip4ConfigModifyVariable (
|
|||||||
NewVar->CheckSum = (UINT16) (~NetblockChecksum ((UINT8 *) NewVar, TotalLen));
|
NewVar->CheckSum = (UINT16) (~NetblockChecksum ((UINT8 *) NewVar, TotalLen));
|
||||||
return NewVar;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -32,11 +32,11 @@ Abstract:
|
|||||||
//
|
//
|
||||||
#define SIZEOF_IP4_CONFIG_INFO(Ip4Config) \
|
#define SIZEOF_IP4_CONFIG_INFO(Ip4Config) \
|
||||||
(sizeof (EFI_IP4_IPCONFIG_DATA) + \
|
(sizeof (EFI_IP4_IPCONFIG_DATA) + \
|
||||||
sizeof (EFI_IP4_ROUTE_TABLE) * (MAX (1, (Ip4Config)->RouteTableSize) - 1))
|
sizeof (EFI_IP4_ROUTE_TABLE) * (Ip4Config)->RouteTableSize)
|
||||||
|
|
||||||
#define SIZEOF_NIC_IP4_CONFIG_INFO(NicConfig) \
|
#define SIZEOF_NIC_IP4_CONFIG_INFO(NicConfig) \
|
||||||
(sizeof (NIC_IP4_CONFIG_INFO) + \
|
(sizeof (NIC_IP4_CONFIG_INFO) + \
|
||||||
sizeof (EFI_IP4_ROUTE_TABLE) * (MAX (1, (NicConfig)->Ip4Info.RouteTableSize) - 1))
|
sizeof (EFI_IP4_ROUTE_TABLE) * (NicConfig)->Ip4Info.RouteTableSize)
|
||||||
|
|
||||||
//
|
//
|
||||||
// Compare whether two NIC address are equal includes their type and length.
|
// Compare whether two NIC address are equal includes their type and length.
|
||||||
@ -72,4 +72,10 @@ Ip4ConfigModifyVariable (
|
|||||||
IN NIC_ADDR *NicAddr,
|
IN NIC_ADDR *NicAddr,
|
||||||
IN NIC_IP4_CONFIG_INFO *Config OPTIONAL
|
IN NIC_IP4_CONFIG_INFO *Config OPTIONAL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
Ip4ConfigFixRouteTablePointer (
|
||||||
|
IN EFI_IP4_IPCONFIG_DATA *ConfigData
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user