Cache4 = &Private->DhcpAck.Dhcp4;\r
}\r
\r
- ASSERT (Cache4->OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL);\r
+ if (Cache4->OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] == NULL) {\r
+ //\r
+ // This should never happen in a correctly configured DHCP / PXE\r
+ // environment. One misconfiguration that can cause it is two DHCP servers\r
+ // mistakenly running on the same network segment at the same time, and\r
+ // racing each other in answering DHCP requests. Thus, the DHCP packets\r
+ // that the edk2 PXE client considers "belonging together" may actually be\r
+ // entirely independent, coming from two (competing) DHCP servers.\r
+ //\r
+ // Try to deal with this gracefully. Note that this check is not\r
+ // comprehensive, as we don't try to identify all such errors.\r
+ //\r
+ return EFI_PROTOCOL_ERROR;\r
+ }\r
\r
//\r
// Parse the boot server address.\r
Cache6 = &Private->DhcpAck.Dhcp6;\r
}\r
\r
- ASSERT (Cache6->OptList[PXEBC_DHCP6_IDX_BOOT_FILE_URL] != NULL);\r
+ if (Cache6->OptList[PXEBC_DHCP6_IDX_BOOT_FILE_URL] == NULL) {\r
+ //\r
+ // This should never happen in a correctly configured DHCP / PXE\r
+ // environment. One misconfiguration that can cause it is two DHCP servers\r
+ // mistakenly running on the same network segment at the same time, and\r
+ // racing each other in answering DHCP requests. Thus, the DHCP packets\r
+ // that the edk2 PXE client considers "belonging together" may actually be\r
+ // entirely independent, coming from two (competing) DHCP servers.\r
+ //\r
+ // Try to deal with this gracefully. Note that this check is not\r
+ // comprehensive, as we don't try to identify all such errors.\r
+ //\r
+ return EFI_PROTOCOL_ERROR;\r
+ }\r
\r
//\r
// Set the station address to IP layer.\r