if (EFI_ERROR (Status)) {\r
goto ON_ERROR;\r
}\r
+\r
+ //\r
+ //DHCP4 service allows only one of its children to be configured in \r
+ //the active state, If the DHCP4 D.O.R.A started by IP4 auto \r
+ //configuration and has not been completed, the Dhcp4 state machine \r
+ //will not be in the right state for the PXE to start a new round D.O.R.A. \r
+ //so we need to switch it's policy to static.\r
+ //\r
+ Status = PxeBcSetIp4Policy (Private);\r
+ if (EFI_ERROR (Status)) {\r
+ goto ON_ERROR;\r
+ }\r
}\r
\r
//\r
UINTN FragmentIndex;\r
UINT8 *FragmentBuffer;\r
\r
- if (This == NULL || DestIp == NULL || DestPort == NULL) {\r
+ if (This == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
Udp4Rx = NULL;\r
Udp6Rx = NULL;\r
\r
- if (((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT) != 0 && DestPort == NULL) ||\r
- ((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP) != 0 && SrcIp == NULL) ||\r
- ((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT) != 0 && SrcPort == NULL)) {\r
+ if (((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT) == 0 && DestPort == NULL) ||\r
+ ((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP) == 0 && SrcIp == NULL) ||\r
+ ((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT) == 0 && SrcPort == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
EFI_STATUS Status;\r
BOOLEAN MediaPresent;\r
\r
+ if (FilePath == NULL || !IsDevicePathEnd (FilePath)) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+ \r
VirtualNic = PXEBC_VIRTUAL_NIC_FROM_LOADFILE (This);\r
Private = VirtualNic->Private;\r
PxeBc = &Private->PxeBc;\r
// 3. unsupported.\r
//\r
PxeBc->Stop (PxeBc);\r
+ } else {\r
+ //\r
+ // The DHCP4 can have only one configured child instance so we need to stop\r
+ // reset the DHCP4 child before we return. Otherwise these programs which \r
+ // also need to use DHCP4 will be impacted.\r
+ //\r
+ if (!PxeBc->Mode->UsingIpv6) {\r
+ Private->Dhcp4->Stop (Private->Dhcp4);\r
+ Private->Dhcp4->Configure (Private->Dhcp4, NULL);\r
+ }\r
}\r
\r
return Status;\r