]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c
1. Refine the error handling when the PXE-v4 DHCP offer isn't valid
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcBoot.c
index dd1d76d8206171f1d195d443bdc82fd0894ec288..e26b412781b82b645f32429504711be431a2ef40 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Boot functions implementation for UefiPxeBc Driver.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -1074,6 +1074,9 @@ PxeBcLoadBootFile (
     // Discover the boot information about the bootfile if hasn't.\r
     //\r
     Status = PxeBcDiscoverBootFile (Private, &RequiredSize);\r
+    if (EFI_ERROR (Status)) {\r
+      goto ON_EXIT;\r
+    }\r
 \r
     if (PXEBC_IS_SIZE_OVERFLOWED (RequiredSize)) {\r
       //\r
@@ -1161,6 +1164,8 @@ ON_EXIT:
     AsciiPrint ("\n  PXE-E22: Client received ICMP error from server.\n");\r
   } else if (Status == EFI_TFTP_ERROR) {\r
     AsciiPrint ("\n  PXE-E23: Client received TFTP error from server.\n");\r
+  } else if (Status == EFI_NOT_FOUND) {\r
+    AsciiPrint ("\n  PXE-E53: No boot filename received.\n");\r
   } else if (Status != EFI_BUFFER_TOO_SMALL) {\r
     AsciiPrint ("\n  PXE-E99: Unexpected network error.\n");\r
   }\r