X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=NetworkPkg%2FUefiPxeBcDxe%2FPxeBcBoot.c;fp=NetworkPkg%2FUefiPxeBcDxe%2FPxeBcBoot.c;h=d062a526077b270d35867d22012578e58445bd29;hp=10bbb06f759345d4e2d4ffa3133664b0dd03ff15;hb=3f55418d5396629c4458061f283068b6c46895fc;hpb=4fb393aaa8bb029dc98a1330f40303bf16e2b092 diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c b/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c index 10bbb06f75..d062a52607 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c @@ -482,7 +482,20 @@ PxeBcDhcp4BootInfo ( Cache4 = &Private->DhcpAck.Dhcp4; } - ASSERT (Cache4->OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL); + if (Cache4->OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] == NULL) { + // + // This should never happen in a correctly configured DHCP / PXE + // environment. One misconfiguration that can cause it is two DHCP servers + // mistakenly running on the same network segment at the same time, and + // racing each other in answering DHCP requests. Thus, the DHCP packets + // that the edk2 PXE client considers "belonging together" may actually be + // entirely independent, coming from two (competing) DHCP servers. + // + // Try to deal with this gracefully. Note that this check is not + // comprehensive, as we don't try to identify all such errors. + // + return EFI_PROTOCOL_ERROR; + } // // Parse the boot server address. @@ -612,7 +625,20 @@ PxeBcDhcp6BootInfo ( Cache6 = &Private->DhcpAck.Dhcp6; } - ASSERT (Cache6->OptList[PXEBC_DHCP6_IDX_BOOT_FILE_URL] != NULL); + if (Cache6->OptList[PXEBC_DHCP6_IDX_BOOT_FILE_URL] == NULL) { + // + // This should never happen in a correctly configured DHCP / PXE + // environment. One misconfiguration that can cause it is two DHCP servers + // mistakenly running on the same network segment at the same time, and + // racing each other in answering DHCP requests. Thus, the DHCP packets + // that the edk2 PXE client considers "belonging together" may actually be + // entirely independent, coming from two (competing) DHCP servers. + // + // Try to deal with this gracefully. Note that this check is not + // comprehensive, as we don't try to identify all such errors. + // + return EFI_PROTOCOL_ERROR; + } // // Set the station address to IP layer.