From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: More than 10 MX records returned) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 8B95C220EE115 for ; Tue, 12 Dec 2017 21:11:40 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2017 21:16:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,396,1508828400"; d="scan'208";a="2297082" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga007.jf.intel.com with ESMTP; 12 Dec 2017 21:16:18 -0800 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Dec 2017 21:16:18 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Dec 2017 21:16:18 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Wed, 13 Dec 2017 13:16:16 +0800 From: "Wu, Jiaxin" To: "Ye, Ting" , "edk2-devel@lists.01.org" CC: "Fu, Siyuan" , Karunakar P Thread-Topic: [Patch 1/2] MdeModulePkg/Dhcp4Dxe: Check Media status before starting DHCP process. Thread-Index: AQHTc8MRAyZirNg7KE2l1RMVaW+KY6NAucqw Date: Wed, 13 Dec 2017 05:16:16 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B727416353308@SHSMSX103.ccr.corp.intel.com> References: <1512117526-11308-1-git-send-email-jiaxin.wu@intel.com> <1512117526-11308-2-git-send-email-jiaxin.wu@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTg5ZjJlNTktZjFiOC00MTNiLTg3N2ItZDcwZDg4YmNlNDIzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlRGZXV2b3piUWpTN3prdXIrUGxtTDVLMitrNHBIVEU0YlhKc1lhR1BveUE9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch 1/2] MdeModulePkg/Dhcp4Dxe: 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: , X-List-Received-Date: Wed, 13 Dec 2017 05:11:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ting, In such a case, DHCP process should also be trigged since DHCP doesn't have= the knowledge of media status. We can't return directly since the media ma= y be available. what do you think? Thanks, Jiaxin > -----Original Message----- > From: Ye, Ting > Sent: Wednesday, December 13, 2017 11:33 AM > To: Wu, Jiaxin ; edk2-devel@lists.01.org > Cc: Fu, Siyuan ; Karunakar P > > Subject: RE: [Patch 1/2] MdeModulePkg/Dhcp4Dxe: Check Media status > before starting DHCP process. >=20 > Hi Jiaxin, >=20 > I think the patch need be revised since it does not check the returned st= atus > of NetLibDetectMedia. If NetLibDetectMedia failed to detect the media > status due to some error conditions, MediaPresent is still TRUE and DHCP > will be trigged later even no media is available. >=20 > Thanks, > Ting >=20 >=20 > -----Original Message----- > From: Wu, Jiaxin > Sent: Friday, December 1, 2017 4:39 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; > Karunakar P ; Wu, Jiaxin > Subject: [Patch 1/2] MdeModulePkg/Dhcp4Dxe: Check Media status before > starting DHCP process. >=20 > Cc: Ye Ting > Cc: Fu Siyuan > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Karunakar P > Signed-off-by: Wu Jiaxin > --- > MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c | 13 > ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c > b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c > index 1db4c66..8780414 100644 > --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c > +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c > @@ -1,9 +1,9 @@ > /** @file > This file implement the EFI_DHCP4_PROTOCOL interface. >=20 > -Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 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 > @@ -778,10 +778,11 @@ EfiDhcp4Start ( > IN EFI_EVENT CompletionEvent OPTIONAL > ) > { > DHCP_PROTOCOL *Instance; > DHCP_SERVICE *DhcpSb; > + BOOLEAN MediaPresent; > EFI_STATUS Status; > EFI_TPL OldTpl; >=20 > // > // First validate the parameters > @@ -807,10 +808,20 @@ EfiDhcp4Start ( > if ((DhcpSb->DhcpState !=3D Dhcp4Init) && (DhcpSb->DhcpState !=3D > Dhcp4InitReboot)) { > Status =3D EFI_ALREADY_STARTED; > goto ON_ERROR; > } >=20 > + // > + // Check Media Satus. > + // > + MediaPresent =3D TRUE; > + NetLibDetectMedia (DhcpSb->Controller, &MediaPresent); if > + (!MediaPresent) { > + Status =3D EFI_NO_MEDIA; > + goto ON_ERROR; > + } > + > DhcpSb->IoStatus =3D EFI_ALREADY_STARTED; >=20 > if (EFI_ERROR (Status =3D DhcpInitRequest (DhcpSb))) { > goto ON_ERROR; > } > -- > 1.9.5.msysgit.1