]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg/Ip6Dxe: Clean the invalid IPv6 configuration during driver start.
authorJiaxin Wu <Jiaxin.wu@intel.com>
Wed, 30 Jan 2019 03:24:27 +0000 (11:24 +0800)
committerJiaxin Wu <Jiaxin.wu@intel.com>
Tue, 19 Feb 2019 00:31:15 +0000 (08:31 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1448

*v3: Change the if condition check to only clean the invalid configuration.

*v2: Add the warning debug message.

This patch is to clean the invalid data and continue to start IP6 driver.

Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
NetworkPkg/Ip6Dxe/Ip6Driver.c

index 4c607125a6ad49a935dfdf9138c0010258ba453b..7a96315ccf93fc24841cdaecb48372513be4f01c 100644 (file)
@@ -587,8 +587,17 @@ Ip6DriverBindingStart (
                        DataItem->DataSize,\r
                        DataItem->Data.Ptr\r
                        );\r
-    if (EFI_ERROR(Status) && Status != EFI_NOT_READY) {\r
-      goto UNINSTALL_PROTOCOL;\r
+    if (Status == EFI_INVALID_PARAMETER || Status == EFI_BAD_BUFFER_SIZE) {\r
+      //\r
+      // Clean the invalid ManualAddress configuration.\r
+      //\r
+      Status = Ip6Cfg->SetData (\r
+                         Ip6Cfg,\r
+                         Ip6ConfigDataTypeManualAddress,\r
+                         0,\r
+                         NULL\r
+                         );\r
+      DEBUG ((EFI_D_WARN, "Ip6DriverBindingStart: Clean the invalid ManualAddress configuration.\n"));\r
     }\r
   }\r
 \r
@@ -603,8 +612,17 @@ Ip6DriverBindingStart (
                        DataItem->DataSize,\r
                        DataItem->Data.Ptr\r
                        );\r
-    if (EFI_ERROR(Status)) {\r
-      goto UNINSTALL_PROTOCOL;\r
+    if (Status == EFI_INVALID_PARAMETER || Status == EFI_BAD_BUFFER_SIZE) {\r
+      //\r
+      // Clean the invalid Gateway configuration.\r
+      //\r
+      Status = Ip6Cfg->SetData (\r
+                         Ip6Cfg,\r
+                         Ip6ConfigDataTypeGateway,\r
+                         0,\r
+                         NULL\r
+                         );\r
+      DEBUG ((EFI_D_WARN, "Ip6DriverBindingStart: Clean the invalid Gateway configuration.\n"));\r
     }\r
   }\r
 \r