Revision: 16535
          http://sourceforge.net/p/edk2/code/16535
Author:   sfu5
Date:     2014-12-18 03:03:52 +0000 (Thu, 18 Dec 2014)
Log Message:
-----------
Fix a bug that the gateway is not necessary in a simple PXE network.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <[email protected]>
Reviewed-by: Ye Ting <[email protected]>
Reviewed-by: Fu Siyuan <[email protected]>

Modified Paths:
--------------
    trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c

Modified: trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
===================================================================
--- trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c     2014-12-17 07:03:52 UTC 
(rev 16534)
+++ trunk/edk2/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c     2014-12-18 03:03:52 UTC 
(rev 16535)
@@ -1280,7 +1280,7 @@
     }
 
     //
-    // Find out the gateway address which can route the message whcih send to 
ServerIp.
+    // Find out the gateway address which can route the message which send to 
ServerIp.
     //
     for (Index = 0; Index < Ip6ModeData.RouteCount; Index++) {
       if (NetIp6IsNetEqual (&Private->ServerIp.v6, 
&Ip6ModeData.RouteTable[Index].Destination, 
Ip6ModeData.RouteTable[Index].PrefixLength)) {
@@ -1381,6 +1381,7 @@
   EFI_STATUS                       Status;
   UINT64                           DadTriggerTime;
   EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS    DadXmits;
+  BOOLEAN                          NoGateway;
 
   Status     = EFI_SUCCESS;
   TimeOutEvt = NULL;
@@ -1388,6 +1389,7 @@
   DataSize   = sizeof (EFI_IP6_CONFIG_POLICY);
   Ip6Cfg     = Private->Ip6Cfg;
   Ip6        = Private->Ip6;
+  NoGateway  = FALSE;
 
   ZeroMem (&CfgAddr, sizeof (EFI_IP6_CONFIG_MANUAL_ADDRESS));
   CopyMem (&CfgAddr.Address, Address, sizeof (EFI_IPv6_ADDRESS));
@@ -1402,7 +1404,7 @@
   //
   Status = PxeBcCheckRouteTable (Private, PXEBC_IP6_ROUTE_TABLE_TIMEOUT, 
&GatewayAddr);
   if (EFI_ERROR (Status)) {
-    goto ON_EXIT;
+    NoGateway = TRUE;
   }
   
   //
@@ -1503,7 +1505,7 @@
   //
   // Set the default gateway address back if needed.
   //
-  if (!NetIp6IsUnspecifiedAddr (&GatewayAddr)) {
+  if (!NoGateway && !NetIp6IsUnspecifiedAddr (&GatewayAddr)) {
     Status = Ip6Cfg->SetData (
                        Ip6Cfg,
                        Ip6ConfigDataTypeGateway,


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to