This patch is used to fix HTTP IPv6 boot failure in diff net segment
issue. IPv6 gateway address should be registered before DNS query,
otherwise, DNS query will fail.

Cc: Ye Ting <ting...@intel.com>
Cc: Zhang Lubo <lubo.zh...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin...@intel.com>
---
 NetworkPkg/HttpBootDxe/HttpBootClient.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.c 
b/NetworkPkg/HttpBootDxe/HttpBootClient.c
index 46cf9ca..0d4061d 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootClient.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootClient.c
@@ -298,10 +298,18 @@ HttpBootDhcp6ExtractUriInfo (
   //
   Status = HttpBootSetIp6Address (Private);
   if (EFI_ERROR (Status)) {
     return Status;
   }
+
+  //
+  // Register the IPv6 gateway address to the network device.
+  //
+  Status = HttpBootSetIp6Gateway (Private);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
   
   //
   // Configure the default DNS server if server assigned.
   //
   if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) || 
@@ -354,19 +362,11 @@ HttpBootDhcp6ExtractUriInfo (
     if (EFI_ERROR (Status)) {
       goto Error;
     }  
   } 
   
-  CopyMem (&Private->ServerIp.v6, &IpAddr, sizeof (EFI_IPv6_ADDRESS));  
-    
-  //
-  // register the IPv6 gateway address to the network device.
-  //
-  Status = HttpBootSetIp6Gateway (Private);
-  if (EFI_ERROR (Status)) {
-    return Status;
-  }
+  CopyMem (&Private->ServerIp.v6, &IpAddr, sizeof (EFI_IPv6_ADDRESS));
   
   //
   // Extract the port from URL, and use default HTTP port 80 if not provided.
   //
   Status = HttpUrlGetPort (
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to