]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix a bug that the gateway is not necessary in a simple PXE network.
authorGary Lin <glin@suse.com>
Thu, 18 Dec 2014 03:03:52 +0000 (03:03 +0000)
committersfu5 <sfu5@Edk2>
Thu, 18 Dec 2014 03:03:52 +0000 (03:03 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16535 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c

index 111224cea2e2ae53452bd90c2b4c7b56cacd5ea5..07f1724365f4dc7078d2c833ec4abefe9808ae93 100644 (file)
@@ -1280,7 +1280,7 @@ PxeBcCheckRouteTable (
     }\r
 \r
     //\r
-    // Find out the gateway address which can route the message whcih send to ServerIp.\r
+    // Find out the gateway address which can route the message which send to ServerIp.\r
     //\r
     for (Index = 0; Index < Ip6ModeData.RouteCount; Index++) {\r
       if (NetIp6IsNetEqual (&Private->ServerIp.v6, &Ip6ModeData.RouteTable[Index].Destination, Ip6ModeData.RouteTable[Index].PrefixLength)) {\r
@@ -1381,6 +1381,7 @@ PxeBcRegisterIp6Address (
   EFI_STATUS                       Status;\r
   UINT64                           DadTriggerTime;\r
   EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS    DadXmits;\r
+  BOOLEAN                          NoGateway;\r
 \r
   Status     = EFI_SUCCESS;\r
   TimeOutEvt = NULL;\r
@@ -1388,6 +1389,7 @@ PxeBcRegisterIp6Address (
   DataSize   = sizeof (EFI_IP6_CONFIG_POLICY);\r
   Ip6Cfg     = Private->Ip6Cfg;\r
   Ip6        = Private->Ip6;\r
+  NoGateway  = FALSE;\r
 \r
   ZeroMem (&CfgAddr, sizeof (EFI_IP6_CONFIG_MANUAL_ADDRESS));\r
   CopyMem (&CfgAddr.Address, Address, sizeof (EFI_IPv6_ADDRESS));\r
@@ -1402,7 +1404,7 @@ PxeBcRegisterIp6Address (
   //\r
   Status = PxeBcCheckRouteTable (Private, PXEBC_IP6_ROUTE_TABLE_TIMEOUT, &GatewayAddr);\r
   if (EFI_ERROR (Status)) {\r
-    goto ON_EXIT;\r
+    NoGateway = TRUE;\r
   }\r
   \r
   //\r
@@ -1503,7 +1505,7 @@ PxeBcRegisterIp6Address (
   //\r
   // Set the default gateway address back if needed.\r
   //\r
-  if (!NetIp6IsUnspecifiedAddr (&GatewayAddr)) {\r
+  if (!NoGateway && !NetIp6IsUnspecifiedAddr (&GatewayAddr)) {\r
     Status = Ip6Cfg->SetData (\r
                        Ip6Cfg,\r
                        Ip6ConfigDataTypeGateway,\r