From nobody Sun May 5 02:55:39 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490335207662750.9325005935839; Thu, 23 Mar 2017 23:00:07 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7D5C58044B; Thu, 23 Mar 2017 23:00:05 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 4AE1B8044A for ; Thu, 23 Mar 2017 23:00:04 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Mar 2017 23:00:03 -0700 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.108]) by orsmga004.jf.intel.com with ESMTP; 23 Mar 2017 23:00:02 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490335204; x=1521871204; h=from:to:cc:subject:date:message-id; bh=27RFoONXlNoPrbWqL/WYywQCjJhSA4T+e1sE8BsnyFM=; b=PzAadGODSjOvXHzs4kwY35rcn12OfbknvK4o0NUqSBYBD7VFAqHKGCeF ut3qBk72fIn/NHF6Kt597q75dOGojw==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,213,1486454400"; d="scan'208";a="70220233" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Fri, 24 Mar 2017 14:00:01 +0800 Message-Id: <1490335201-11376-1-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [edk2] [Patch] NetworkPkg/DnsDxe: Fix zero StationIp configuration failure of DNSv6 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: , Cc: Ye Ting , Zhang Lubo , Fu Siyuan , Wu Jiaxin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" According UEFI Spec, set to zero StationIp means to let the underlying IPv6 driver choose a source address. But currently, DNSv6 always return EFI_NO_MAPPING. The issue is caused by below bugs in DnsDxe: * Incorrect TPL(TPL_CALLBACK) usage during UDP configuration. * Failed to create the timer used to get IPv6 mapping * Doesn't check the Ip6Mode.IsStarted flag. Cc: Zhang Lubo Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Zhang Lubo --- NetworkPkg/DnsDxe/DnsDriver.c | 24 +++++++++++------------- NetworkPkg/DnsDxe/DnsImpl.c | 8 +++++--- NetworkPkg/DnsDxe/DnsProtocol.c | 2 ++ 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/NetworkPkg/DnsDxe/DnsDriver.c b/NetworkPkg/DnsDxe/DnsDriver.c index c000b5f..5dc9afe 100644 --- a/NetworkPkg/DnsDxe/DnsDriver.c +++ b/NetworkPkg/DnsDxe/DnsDriver.c @@ -1,9 +1,9 @@ /** @file The driver binding and service binding protocol for DnsDxe driver. =20 -Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
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 http://opensource.org/licenses/bsd-license.php =20 @@ -277,22 +277,20 @@ DnsCreateService ( =20 // // Create the timer used to time out the procedure which is used to // get the default IP address. // - if (DnsSb->IpVersion =3D=3D IP_VERSION_4) { - Status =3D gBS->CreateEvent ( - EVT_TIMER, - TPL_CALLBACK, - NULL, - NULL, - &DnsSb->TimerToGetMap - ); - if (EFI_ERROR (Status)) { - FreePool (DnsSb); - return Status; - } + Status =3D gBS->CreateEvent ( + EVT_TIMER, + TPL_CALLBACK, + NULL, + NULL, + &DnsSb->TimerToGetMap + ); + if (EFI_ERROR (Status)) { + FreePool (DnsSb); + return Status; } =20 // // Create the timer to retransmit packets. // diff --git a/NetworkPkg/DnsDxe/DnsImpl.c b/NetworkPkg/DnsDxe/DnsImpl.c index 794df1d..ea3d27d 100644 --- a/NetworkPkg/DnsDxe/DnsImpl.c +++ b/NetworkPkg/DnsDxe/DnsImpl.c @@ -1,9 +1,9 @@ /** @file DnsDxe support functions implementation. =20 -Copyright (c) 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
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 http://opensource.org/licenses/bsd-license.php =20 @@ -641,13 +641,15 @@ Dns6GetMapping ( =20 if (Ip6Mode.IcmpTypeList !=3D NULL) { FreePool (Ip6Mode.IcmpTypeList); } =20 - if (Ip6Mode.IsConfigured) { + if (!Ip6Mode.IsStarted || Ip6Mode.IsConfigured) { Udp->Configure (Udp, NULL); - return (BOOLEAN) (Udp->Configure (Udp, UdpCfgData) =3D=3D EFI_SUCC= ESS); + if (Udp->Configure (Udp, UdpCfgData) =3D=3D EFI_SUCCESS) { + return TRUE; + } } } } =20 return FALSE; diff --git a/NetworkPkg/DnsDxe/DnsProtocol.c b/NetworkPkg/DnsDxe/DnsProtoco= l.c index 0e7ed34..bd189ae 100644 --- a/NetworkPkg/DnsDxe/DnsProtocol.c +++ b/NetworkPkg/DnsDxe/DnsProtocol.c @@ -1104,11 +1104,13 @@ Dns6Configure ( } =20 // // Config UDP // + gBS->RestoreTPL (OldTpl); Status =3D Dns6ConfigUdp (Instance, Instance->UdpIo); + OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); if (EFI_ERROR (Status)) { if (Instance->Dns6CfgData.DnsServerList !=3D NULL) { FreePool (Instance->Dns6CfgData.DnsServerList); Instance->Dns6CfgData.DnsServerList =3D NULL; } --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel