]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix issue that node is still reachable after executing ifconfig –c.
authortye1 <tye1@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 14 Nov 2012 01:43:18 +0000 (01:43 +0000)
committertye1 <tye1@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 14 Nov 2012 01:43:18 +0000 (01:43 +0000)
Signed-off-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ouyang Qian <qian.ouyang@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13940 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c

index 7288234bfab89ac373439b2064047e866d8f564a..5493d07d10156e717ec918a0a541c6fd4f23a6cb 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   This code implements the IP4Config and NicIp4Config protocols.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at<BR>\r
@@ -125,6 +125,15 @@ EfiNicIp4ConfigSetInfo (
   // Signal the IP4 to run the auto configuration again\r
   //\r
   if (Reconfig && (Instance->ReconfigEvent != NULL)) {\r
+    //\r
+    // When NicConfig is NULL, NIC IP4 configuration parameter is removed,\r
+    // the auto configuration process should stop running the configuration\r
+    // policy for the EFI IPv4 Protocol driver.\r
+    //\r
+    if (NicConfig == NULL) {\r
+      Instance->DoNotStart = TRUE;\r
+    }\r
+\r
     Status = gBS->SignalEvent (Instance->ReconfigEvent);\r
     DispatchDpc ();\r
   }\r
@@ -344,6 +353,12 @@ EfiIp4ConfigStart (
   Instance->NicConfig     = EfiNicIp4ConfigGetInfo (Instance);\r
 \r
   if (Instance->NicConfig == NULL) {\r
+    if (Instance->DoNotStart) {\r
+      Instance->DoNotStart = FALSE;\r
+      Status = EFI_SUCCESS;\r
+      goto ON_EXIT;\r
+    }\r
+\r
     Source = IP4_CONFIG_SOURCE_DHCP;\r
   } else {\r
     Source = Instance->NicConfig->Source;\r
index b3d8acae9bb98701f5d8455acbd9c651f0328939..cbe8ec5fcfde864b06d1a2ef3af0a5fdf30f1355 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Header file for IP4Config driver.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at<BR>\r
@@ -137,7 +137,12 @@ typedef struct _IP4_CONFIG_INSTANCE {
   //\r
   // Underlying media present status. \r
   //\r
-  BOOLEAN                         MediaPresent; \r
+  BOOLEAN                         MediaPresent;\r
+\r
+  //\r
+  // A flag to indicate EfiIp4ConfigStart should not run\r
+  //\r
+  BOOLEAN                         DoNotStart;\r
 } IP4_CONFIG_INSTANCE;\r
 \r
 #define IP4_CONFIG_INSTANCE_FROM_IP4CONFIG(this) \\r
index eee306ad3b9c6f3dd09a39dc7a565bb409e459c8..2a9fcb94e5b573344d81fee407ccf619799b576c 100644 (file)
@@ -87,7 +87,8 @@ IP4_CONFIG_INSTANCE        mIp4ConfigTemplate = {
   NULL,\r
   NULL,\r
   NULL,\r
-  TRUE\r
+  TRUE,\r
+  FALSE\r
 };\r
 \r
 /**\r
index 2878863adea4bde4876e14f940d8e79eecd6249d..f09bd51744af97e0212d54b8b349fd66576ccce9 100644 (file)
@@ -215,7 +215,7 @@ Ip4ConfigConvertIfrNvDataToDeviceConfigData (
     //\r
     ZeroMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo, sizeof (IP4_SETTING_INFO));\r
 \r
-    Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NULL, FALSE);\r
+    Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NULL, TRUE);\r
     if (Status == EFI_NOT_FOUND) {\r
       return EFI_SUCCESS;\r
     }\r
@@ -629,7 +629,7 @@ Ip4DeviceRouteConfig (
         FreePool (NicInfo);\r
       } else {\r
         ZeroMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo, sizeof (IP4_SETTING_INFO));\r
-        Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NULL, FALSE);\r
+        Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NULL, TRUE);\r
       }\r
     }\r
 \r