]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
Fix bug for UefiPxeBcDxe driver to catch the return status.
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcImpl.c
index cd8eab3df904d65d4ee57a957d5c003ff12e1626..ae81693bfb5879d55130a956b29e6d70bc2e68c1 100644 (file)
@@ -321,6 +321,8 @@ EfiPxeBcStop (
   gBS->CloseEvent (Private->UdpTimeOutEvent);\r
   Private->CurSrcPort   = 0;\r
   Private->BootFileSize = 0;\r
+  Private->SolicitTimes = 0;\r
+  Private->ElapsedTime  = 0;\r
 \r
   //\r
   // Reset the mode data.\r
@@ -386,6 +388,8 @@ EfiPxeBcDhcp (
   Mode->IcmpErrorReceived = FALSE;\r
   Private->Function       = EFI_PXE_BASE_CODE_FUNCTION_DHCP;\r
   Private->IsOfferSorted  = SortOffers;\r
+  Private->SolicitTimes   = 0;\r
+  Private->ElapsedTime    = 0;\r
 \r
   if (!Mode->Started) {\r
     return EFI_NOT_STARTED;\r
@@ -403,6 +407,10 @@ EfiPxeBcDhcp (
     //\r
     Status = PxeBcDhcp6Sarr (Private, Private->Dhcp6);\r
 \r
+    if (EFI_ERROR (Status)) {\r
+      return Status;\r
+    }\r
+\r
     //\r
     // Configure Udp6Read instance\r
     //\r
@@ -419,6 +427,10 @@ EfiPxeBcDhcp (
     //\r
     Status = PxeBcDhcp4Dora (Private, Private->Dhcp4);\r
 \r
+    if (EFI_ERROR (Status)) {\r
+      return Status;\r
+    }\r
+\r
     //\r
     // Configure Udp4Read instance\r
     //\r
@@ -657,7 +669,9 @@ EfiPxeBcDiscover (
                );\r
   }\r
 \r
-  if (!EFI_ERROR (Status)) {\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;    \r
+  } else {\r
     //\r
     // Parse the cached PXE reply packet, and store it into mode data if valid.\r
     //\r
@@ -925,6 +939,10 @@ EfiPxeBcMtftp (
     Mode->IcmpErrorReceived = TRUE;\r
   }\r
 \r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
   if (Mode->UsingIpv6) {\r
     Status = Private->Udp6Read->Configure (Private->Udp6Read, &Private->Udp6CfgData);    \r
   } else {\r