Revision: 13940
          http://edk2.svn.sourceforge.net/edk2/?rev=13940&view=rev
Author:   tye1
Date:     2012-11-14 01:43:18 +0000 (Wed, 14 Nov 2012)
Log Message:
-----------
Fix issue that node is still reachable after executing ifconfig 
?\226?\128?\147c.

Signed-off-by: Ye Ting <[email protected]>
Reviewed-by: Fu Siyuan <[email protected]>
Reviewed-by: Ouyang Qian <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
    trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h
    trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
    trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c

Modified: trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c  
2012-11-13 22:39:09 UTC (rev 13939)
+++ trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c  
2012-11-14 01:43:18 UTC (rev 13940)
@@ -1,7 +1,7 @@
 /** @file
   This code implements the IP4Config and NicIp4Config protocols.
 
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at<BR>
@@ -125,6 +125,15 @@
   // Signal the IP4 to run the auto configuration again
   //
   if (Reconfig && (Instance->ReconfigEvent != NULL)) {
+    //
+    // When NicConfig is NULL, NIC IP4 configuration parameter is removed,
+    // the auto configuration process should stop running the configuration
+    // policy for the EFI IPv4 Protocol driver.
+    //
+    if (NicConfig == NULL) {
+      Instance->DoNotStart = TRUE;
+    }
+
     Status = gBS->SignalEvent (Instance->ReconfigEvent);
     DispatchDpc ();
   }
@@ -344,6 +353,12 @@
   Instance->NicConfig     = EfiNicIp4ConfigGetInfo (Instance);
 
   if (Instance->NicConfig == NULL) {
+    if (Instance->DoNotStart) {
+      Instance->DoNotStart = FALSE;
+      Status = EFI_SUCCESS;
+      goto ON_EXIT;
+    }
+
     Source = IP4_CONFIG_SOURCE_DHCP;
   } else {
     Source = Instance->NicConfig->Source;

Modified: trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h  
2012-11-13 22:39:09 UTC (rev 13939)
+++ trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h  
2012-11-14 01:43:18 UTC (rev 13940)
@@ -1,7 +1,7 @@
 /** @file
   Header file for IP4Config driver.
 
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at<BR>
@@ -137,7 +137,12 @@
   //
   // Underlying media present status. 
   //
-  BOOLEAN                         MediaPresent; 
+  BOOLEAN                         MediaPresent;
+
+  //
+  // A flag to indicate EfiIp4ConfigStart should not run
+  //
+  BOOLEAN                         DoNotStart;
 } IP4_CONFIG_INSTANCE;
 
 #define IP4_CONFIG_INSTANCE_FROM_IP4CONFIG(this) \

Modified: 
trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c    
2012-11-13 22:39:09 UTC (rev 13939)
+++ trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c    
2012-11-14 01:43:18 UTC (rev 13940)
@@ -87,7 +87,8 @@
   NULL,
   NULL,
   NULL,
-  TRUE
+  TRUE,
+  FALSE
 };
 
 /**

Modified: trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c        
2012-11-13 22:39:09 UTC (rev 13939)
+++ trunk/edk2/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c        
2012-11-14 01:43:18 UTC (rev 13940)
@@ -215,7 +215,7 @@
     //
     ZeroMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo, sizeof 
(IP4_SETTING_INFO));
 
-    Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NULL, FALSE);
+    Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NULL, TRUE);
     if (Status == EFI_NOT_FOUND) {
       return EFI_SUCCESS;
     }
@@ -629,7 +629,7 @@
         FreePool (NicInfo);
       } else {
         ZeroMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo, sizeof 
(IP4_SETTING_INFO));
-        Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NULL, FALSE);
+        Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NULL, TRUE);
       }
     }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to