]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
PXE driver bug fix.
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcImpl.c
index 07f2b6cfc29f8987a1d9b7e415996106c381c70a..19c83d3234fde237f4c82b0168462e6bb19e353b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   This implementation of EFI_PXE_BASE_CODE_PROTOCOL and EFI_LOAD_FILE_PROTOCOL.\r
 \r
-  Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2007 - 2015, 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
@@ -124,6 +124,14 @@ EfiPxeBcStart (
     if (EFI_ERROR (Status)) {\r
       goto ON_ERROR;\r
     }\r
+\r
+    //\r
+    // Set Ip6 policy to Automatic to start the IP6 router discovery.\r
+    //\r
+    Status = PxeBcSetIp6Policy (Private);\r
+    if (EFI_ERROR (Status)) {\r
+      goto ON_ERROR;\r
+    }\r
   } else {\r
     AsciiPrint ("\n>>Start PXE over IPv4");\r
     //\r
@@ -338,6 +346,7 @@ EfiPxeBcStop (
       gBS->CloseEvent (Private->IcmpToken.Event);\r
       Private->IcmpToken.Event = NULL;\r
     }\r
+    Private->BootFileName = NULL;\r
   }\r
 \r
   gBS->CloseEvent (Private->UdpTimeOutEvent);\r
@@ -345,6 +354,10 @@ EfiPxeBcStop (
   Private->BootFileSize = 0;\r
   Private->SolicitTimes = 0;\r
   Private->ElapsedTime  = 0;\r
+  ZeroMem (&Private->StationIp, sizeof (EFI_IP_ADDRESS));\r
+  ZeroMem (&Private->SubnetMask, sizeof (EFI_IP_ADDRESS));\r
+  ZeroMem (&Private->GatewayIp, sizeof (EFI_IP_ADDRESS));\r
+  ZeroMem (&Private->ServerIp, sizeof (EFI_IP_ADDRESS));\r
 \r
   //\r
   // Reset the mode data.\r
@@ -596,6 +609,7 @@ EfiPxeBcDiscover (
     if (EFI_ERROR (Status)) {\r
       goto ON_EXIT;\r
     }\r
+    ASSERT (NewCreatedInfo != NULL);\r
     Info = NewCreatedInfo;\r
   } else {\r
     //\r
@@ -612,7 +626,7 @@ EfiPxeBcDiscover (
       if (Index != Info->IpCnt) {\r
         //\r
         // It's invalid if the first server doesn't accecpt any response\r
-        // and meanwhile any of the rest servers accept any reponse.\r
+        // but any of the other servers does accept any response.\r
         //\r
         Status = EFI_INVALID_PARAMETER;\r
         goto ON_EXIT;\r
@@ -2020,7 +2034,7 @@ EfiPxeBcSetStationIP (
     CopyMem (&Private->SubnetMask ,NewSubnetMask, sizeof (EFI_IP_ADDRESS));\r
   }\r
 \r
-  Status = PxeBcFlushStaionIp (Private, NewStationIp, NewSubnetMask);\r
+  Status = PxeBcFlushStationIp (Private, NewStationIp, NewSubnetMask);\r
 ON_EXIT:\r
   return Status;\r
 }\r