From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7C3AD2194EB70 for ; Sun, 17 Feb 2019 17:14:47 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Feb 2019 17:14:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,382,1544515200"; d="scan'208";a="118699129" Received: from jiaxinwu-mobl.ccr.corp.intel.com ([10.239.192.99]) by orsmga008.jf.intel.com with ESMTP; 17 Feb 2019 17:14:45 -0800 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Michael Turner , Ye Ting , Fu Siyuan , Wu Jiaxin Date: Mon, 18 Feb 2019 09:14:43 +0800 Message-Id: <20190218011443.11712-1-Jiaxin.wu@intel.com> X-Mailer: git-send-email 2.17.1.windows.2 Subject: [PATCH v3] NetworkPkg/Ip6Dxe: Clean the invalid IPv6 configuration during driver start. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 01:14:47 -0000 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 Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin --- NetworkPkg/Ip6Dxe/Ip6Driver.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.c b/NetworkPkg/Ip6Dxe/Ip6Driver.c index 4c607125a6..7a96315ccf 100644 --- a/NetworkPkg/Ip6Dxe/Ip6Driver.c +++ b/NetworkPkg/Ip6Dxe/Ip6Driver.c @@ -585,12 +585,21 @@ Ip6DriverBindingStart ( Ip6Cfg, Ip6ConfigDataTypeManualAddress, DataItem->DataSize, DataItem->Data.Ptr ); - if (EFI_ERROR(Status) && Status != EFI_NOT_READY) { - goto UNINSTALL_PROTOCOL; + if (Status == EFI_INVALID_PARAMETER || Status == EFI_BAD_BUFFER_SIZE) { + // + // Clean the invalid ManualAddress configuration. + // + Status = Ip6Cfg->SetData ( + Ip6Cfg, + Ip6ConfigDataTypeManualAddress, + 0, + NULL + ); + DEBUG ((EFI_D_WARN, "Ip6DriverBindingStart: Clean the invalid ManualAddress configuration.\n")); } } // // If there is any default gateway address, set it. @@ -601,12 +610,21 @@ Ip6DriverBindingStart ( Ip6Cfg, Ip6ConfigDataTypeGateway, DataItem->DataSize, DataItem->Data.Ptr ); - if (EFI_ERROR(Status)) { - goto UNINSTALL_PROTOCOL; + if (Status == EFI_INVALID_PARAMETER || Status == EFI_BAD_BUFFER_SIZE) { + // + // Clean the invalid Gateway configuration. + // + Status = Ip6Cfg->SetData ( + Ip6Cfg, + Ip6ConfigDataTypeGateway, + 0, + NULL + ); + DEBUG ((EFI_D_WARN, "Ip6DriverBindingStart: Clean the invalid Gateway configuration.\n")); } } // // ready to go: start the receiving and timer -- 2.17.1.windows.2