From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 67FF521A04830 for ; Thu, 6 Apr 2017 01:58:11 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP; 06 Apr 2017 01:58:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,283,1488873600"; d="scan'208";a="83825033" Received: from shwdeopenpsi116.ccr.corp.intel.com ([10.239.9.5]) by orsmga005.jf.intel.com with ESMTP; 06 Apr 2017 01:58:10 -0700 From: Zhang Lubo To: edk2-devel@lists.01.org Cc: Wu Jiaxin , Ye Ting , Fu Siyuan Date: Thu, 6 Apr 2017 16:58:09 +0800 Message-Id: <1491469089-36756-1-git-send-email-lubo.zhang@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [patch] NetworkPkg: Fix bug related DAD issue in IP6 driver. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Apr 2017 08:58:11 -0000 If we set PXEv6 as the first boot option and reboot immediately after the first successful boot, it will assert. the root cause is when we set the policy from manual to automatic in PXE driver, the ip6 Configure item size is already set to zero and other structures are also released, So it is not needed to perform DAD call back function which is invoked by Ip6ConfigSetMaunualAddress. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo Cc: Wu Jiaxin Cc: Ye Ting Cc: Fu Siyuan --- NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c index bde5982..7575b79 100644 --- a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c +++ b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c @@ -782,10 +782,14 @@ Ip6ManualAddrDadCallback ( Instance = (IP6_CONFIG_INSTANCE *) Context; NET_CHECK_SIGNATURE (Instance, IP6_CONFIG_INSTANCE_SIGNATURE); Item = &Instance->DataItem[Ip6ConfigDataTypeManualAddress]; ManualAddr = NULL; + if (Item->DataSize == 0) { + return; + } + for (Index = 0; Index < Item->DataSize / sizeof (EFI_IP6_CONFIG_MANUAL_ADDRESS); Index++) { // // Find the original tag used to place into the NET_MAP. // ManualAddr = Item->Data.ManualAddress + Index; -- 1.9.5.msysgit.1