NetworkPkg: Fix the issue cannot boot to UEFI Network after reset
DHCP4 service allows only one of its children to be configured in the active state,If the DHCP4 D.O.R.A started by IP4 auto configuration and has not been completed, the Dhcp4 state machine will not be in the right state for the PXE to start a new round D.O.R.A. so we need to switch it's policy to static. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18104 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1506,6 +1506,52 @@ PxeBcDhcp4Discover (
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Switch the Ip4 policy to static.
|
||||
|
||||
@param[in] Private The pointer to PXEBC_PRIVATE_DATA.
|
||||
|
||||
@retval EFI_SUCCESS The policy is already configured to static.
|
||||
@retval Others Other error as indicated..
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcSetIp4Policy (
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2;
|
||||
EFI_IP4_CONFIG2_POLICY Policy;
|
||||
UINTN DataSize;
|
||||
|
||||
Ip4Config2 = Private->Ip4Config2;
|
||||
DataSize = sizeof (EFI_IP4_CONFIG2_POLICY);
|
||||
Status = Ip4Config2->GetData (
|
||||
Ip4Config2,
|
||||
Ip4Config2DataTypePolicy,
|
||||
&DataSize,
|
||||
&Policy
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (Policy != Ip4Config2PolicyStatic) {
|
||||
Policy = Ip4Config2PolicyStatic;
|
||||
Status= Ip4Config2->SetData (
|
||||
Ip4Config2,
|
||||
Ip4Config2DataTypePolicy,
|
||||
sizeof (EFI_IP4_CONFIG2_POLICY),
|
||||
&Policy
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Start the D.O.R.A DHCPv4 process to acquire the IPv4 address and other PXE boot information.
|
||||
|
Reference in New Issue
Block a user