From nobody Wed Dec 25 04:36:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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 151211753984461.52350522594588; Fri, 1 Dec 2017 00:38:59 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D33D92211B43F; Fri, 1 Dec 2017 00:34:31 -0800 (PST) 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 E20C1220D4C1E for ; Fri, 1 Dec 2017 00:34:30 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2017 00:38:57 -0800 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.162]) by fmsmga005.fm.intel.com with ESMTP; 01 Dec 2017 00:38:55 -0800 X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,344,1508828400"; d="scan'208";a="182334458" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Fri, 1 Dec 2017 16:38:46 +0800 Message-Id: <1512117526-11308-3-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1512117526-11308-1-git-send-email-jiaxin.wu@intel.com> References: <1512117526-11308-1-git-send-email-jiaxin.wu@intel.com> Subject: [edk2] [Patch 2/2] NetworkPkg/Dhcp6Dxe: Check Media status before starting DHCP process. 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 , Karunakar P , 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" Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Karunakar P Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan --- NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Imp= l.c index d8c0ad0..1107865 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Impl.c @@ -1,9 +1,9 @@ /** @file This EFI_DHCP6_PROTOCOL interface implementation. =20 - Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
=20 This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at http://opensource.org/licenses/bsd-license.php. @@ -74,10 +74,11 @@ EfiDhcp6Start ( { EFI_STATUS Status; EFI_TPL OldTpl; DHCP6_INSTANCE *Instance; DHCP6_SERVICE *Service; + BOOLEAN MediaPresent; =20 if (This =3D=3D NULL) { return EFI_INVALID_PARAMETER; } =20 @@ -99,10 +100,21 @@ EfiDhcp6Start ( if (Instance->IaCb.Ia->State !=3D Dhcp6Init) { return EFI_ALREADY_STARTED; } =20 OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); + + // + // Check Media Satus. + // + MediaPresent =3D TRUE; + NetLibDetectMedia (Service->Controller, &MediaPresent); + if (!MediaPresent) { + Status =3D EFI_NO_MEDIA; + goto ON_ERROR; + } + Instance->UdpSts =3D EFI_ALREADY_STARTED; =20 // // Send the solicit message to start S.A.R.R process. // --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel