From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 27CE974004C for ; Wed, 17 Jan 2024 14:08:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=WdurTJ+1oH32oj+I8OZ2aJrr7c5wxKGIT9ldS+TPpIE=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20140610; t=1705500480; v=1; b=lRgUM0tQW/wDN4IHkqv6ka0VUbA8EH/799yIq21pdYC1TFUhWtXsAiMSSVAm2QTilZkVVNn9 EaVIr/WXPmi/ZqJonlgYzNArvtseXo0nifj6yM031lvSQXMPZjiZDjvXjxTGBCUlCbqLSQayqgd 2AndFg4E2RKoWd7W4tg3nn+o= X-Received: by 127.0.0.2 with SMTP id vEpXYY7687511xvuHZ9GOuRb; Wed, 17 Jan 2024 06:08:00 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.66]) by mx.groups.io with SMTP id smtpd.web11.2944.1705500480050064590 for ; Wed, 17 Jan 2024 06:08:00 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eTexCtu+cD8/YnHYWxRGEjeWO0eh3t/tVtIRJahPdo4TU43IcMAmVTQ63YSjUSiaX/J9tAQ81dx9JQqHHfRXYcHy9Id6GjGdCiAzs5dTx/T+Vrty33oXTZKndooREBI6eMW6v+NcvgBi9keqb/HgCXmg/ZTAbKMjvQQNqSaeLwevYgBweZpuYG2U3335rneixIabSd/vKd9xN0AGnTlh/Ps2RZtsJwm/cptbkPuPc6GyNlJMMLPKKyNL74lnRwop05INLvh/DFfZC9QQjp2v+w6yC7IlE1O/gTyQsnOyLLXpiyDeCKf7XHyCqoODutFrLYzpwX2hw0hVREPfEIufag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=48GNTpYo+DYvgLDkKUtTdO87ZOj/lTp9Hl2Af2MmK4w=; b=AUqmPn45txgxLUG0FzfxvziLIVuX3SNGEgNCsoAGI0bryGwGtZ2VcMRnLXH6FBBrOMlPMJtdOAYKWA3Zzb0Ugf+5kLoS2mZ8AGli+78EWc5ZTtmnuw/DQ7gQM0YWQTuqYNxoCri9YO9BCyaPd6mrJJ9onuwXz/xkKOPIIsOjOcFrFzpgr+WBFhlctk9bLumEKaOEQ9BpbSMYNhobUrUjwADBUkSbwuXPgOQTAwXkZxHuj1vh+XeByHRe3X4kLyTWJG5VsCp/ROuPVjQVZsvkZCiVjK55FycqVRcnRoRPPPopReG+QokpclaIEEXW7x3yP/Dfd576erAeeXnek0I2Zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none X-Received: from BY5PR12MB5544.namprd12.prod.outlook.com (2603:10b6:a03:1d9::22) by CY5PR12MB6300.namprd12.prod.outlook.com (2603:10b6:930:f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.29; Wed, 17 Jan 2024 14:07:55 +0000 X-Received: from BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::24be:aa60:3324:1068]) by BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::24be:aa60:3324:1068%6]) with mapi id 15.20.7181.022; Wed, 17 Jan 2024 14:07:54 +0000 From: "Ashish Singhal via groups.io" To: "Kasbekar, Saloni" , "devel@edk2.groups.io" , "Clark-williams, Zachary" , Jeff Brasen Subject: Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thread-Topic: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thread-Index: AQHaLuc9P9mSwxDcuUyB3JunDYT5ybDFRozEgAHVYACAATCxsoAB974AgADi4GyAAJ7xgIAASRGvgBIv8qc= Date: Wed, 17 Jan 2024 14:07:54 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BY5PR12MB5544:EE_|CY5PR12MB6300:EE_ x-ms-office365-filtering-correlation-id: dfd3d291-f3a2-4959-ca65-08dc1765b328 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: ke7553cpCSyyGW6GzdQsxZc+1JAUMnoBRi1qenWlrtUd4x0YHFihkyotPbHdKtOZW5a1WeTDH2SfyQKyC6xs2ChtBfgT4MIHVecvQYOzfzvobmFYR2b/AM0hKJf1n1hJA0qIObINhzhGFEgLfagMLFLUnLEuKKaCxBhq2AIdRCbhb81BMeHgwAi05uUDxiM3ztEy8t6NAIB32P75r2sYHAdAFOmYH3gXuNlwWYDPlH/sV8u8KS/4bL6lr4d7IwM398hTnl8DK4/VcVSIGahA9bHBb+nZ4ruRP3CYc9D+cGmDtaU53srxiL2XlAlo3BDEBfpqdOnA6e7FMw7V0iPPDqRwDCM3/bievjyzA/vV2gxRcspiMmYZGuhllKuRaHRNgvxDabpUlUFBLGYG2GpdscBC/AV7IJyrRWjB/upQxPNVkg7VIMSiYy2P54+Vsm4ZeNjSLjnpIkAsOgiKCDsPwZa8gPMsy4RbDElCIccGPx8EDaW2rQqRDM4eZfgoAC5tx6XALFZauHrO5r8hKQpW8uo6JcFClLAxUd3qsUKGxnsg5dNH6f9IzktxMNEp2wjP/Uxtf4mJj4RzRjbHCB9WWKdS1TVrZUpnmme/6gn6f6R4RNh4n4Uejg4naB9gC6+WGPiIagLYYuruY1/f3Q1ftA== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?2nq9BF4i41EngFgbqGUDAR32OF+DmGnSOQYRrHhK+qtFn76/u8Qtc1yY?= =?Windows-1252?Q?f0KDie0DIbkHmJbo0NQl/XAQT72VWImoDhEkGWgZvcibNHH5pKBMPfXz?= =?Windows-1252?Q?4yLdkY5/4qQ4GOorZMjMias6YZxpzrHS61k7X8L42YLU5/4AHT1/GN51?= =?Windows-1252?Q?u6OygWqd/bXz+DH9q/uObcz5OZGGObo5daDUkkc/C4X+15R+JEVxZlgA?= =?Windows-1252?Q?bJFWkpMW9QWL4PZf2cqOfMDzrzRWyJ+Lpr2mJ0MSGhuOT7cI9+wbfofg?= =?Windows-1252?Q?74dEc7bYvdDJ+9xNZUxrvW+97/pnztSWqQ7dVBfurDUAYIYVqtTNx6mI?= =?Windows-1252?Q?g0+5RdCaOgFHgJ42X74nZuTYC3uuQHtSQAzFNkQpEFVp2GB7qjwl8hdo?= =?Windows-1252?Q?QwRccO9d9H4PnXlnBRx55L955ATNzYxi7tcCECxoaTC1nkzeQeH4yD50?= =?Windows-1252?Q?HO8h/CdJAjDcg5JRTcWb1d6v3mzvMPNgVYbTL0+V+AyJTIQCLSay4xcG?= =?Windows-1252?Q?RzgHhqRwfoK//KLEpGZ+rQF8AqGXXfBP9Xnp9xNj/EEWZtkh+/kqPunz?= =?Windows-1252?Q?E/6Yw2dctPr0TYdhLa9ne70TqQ5k71ehn7op9kD8C+Fqpcd+m8lgRmFG?= =?Windows-1252?Q?qOGvvcTuQrGsBSnjcY242/zsdu8WOJQC0DA+FSIs+laRy9xEV29ikl+5?= =?Windows-1252?Q?EqyF5VBW4wN9hitwAobVWws2TtWuwjuwvxcx+qzfbXAbHVwRlqEJTZ+7?= =?Windows-1252?Q?DZjSIAeQ4Le67Y/wsz2/bviWSGH3J8YTUPjYpTNRXZp6ZzavmWJFOp7E?= =?Windows-1252?Q?pqJ5IyVgs/CtNHQhtxr8addwW2bkODw4bnJHpJKrO/kQfpbIEhp21NIy?= =?Windows-1252?Q?+WLCTuKBQGJ7CQzBvhV8+r+HPKdKxXYBFS1whN/6Vr91D3WJebDEtqn3?= =?Windows-1252?Q?Evv8xUKM8wlBHCbdnkzP5FGAbbP1JoQWPJICSsGSaNxvGiNe2aBT14C/?= =?Windows-1252?Q?reu5rv0dbnfs+dbTJ9Q/r4fbWpSI488ewDxFdFXUNunzU0ospOTMdjbc?= =?Windows-1252?Q?Z2C5kapCXiXqGFMUy4Kd2HuExAB5q+G3KnmGs7FCRiM0+E5q82e89qsz?= =?Windows-1252?Q?dbbzRooddEqRxP0032QILtH6hhBQjdaXGKTYvq7M9D4YAdD4N1OIVxq0?= =?Windows-1252?Q?g0EZLSikPoND99CrZMX2wytRZS87cMy5HuE4ouYGnoBOu4axKHCjMIXq?= =?Windows-1252?Q?UTPGpdBTlHN5TcEksREaDyXveDnh+K6+iKQO2ssDxgkhevnXWoXCQ0ob?= =?Windows-1252?Q?p4h9pAkdfd3pUdQwJTxJAe2R1PkP3q2Zgtjc4CMIB8VOA7H4yYVCJFUB?= =?Windows-1252?Q?yqR5X7XTt6jKmiJYQ2jteyDb1jlEI/m4+/+o+PR7epUnw3Fhjgg3f6vo?= =?Windows-1252?Q?MWNlRcFYNWhS4GLLUfWmGH+9AqbTBJW2M23kuLltS0B6WB7oGehAH0q3?= =?Windows-1252?Q?WdcfxjJRZYgUxPs4omH5npqgC1f0U/8AyXi8kWlre9rBBbs67uKhRkFt?= =?Windows-1252?Q?lTFGPViBzEtQTEs4t5FJATn4+dGGcI5E4Wu5OBTuZORRWT9R6fUvHinF?= =?Windows-1252?Q?6LQ27WfpV7PVl2nQeDYGU8u1PNwf8RwPclipzRdlhO3QztzOl6qDUajd?= =?Windows-1252?Q?Gg9ajOnVYgdnbUM/y60PndK8aLIQ+Hfa?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB5544.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dfd3d291-f3a2-4959-ca65-08dc1765b328 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2024 14:07:54.4099 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: HLsASBv8dwlgoc2x3zK12Dpa6xoJ/VcFqzyX+bIxDwQsSBSvjY5/JCMHB/RiH2Y3tyOwm9U9bfeTbgO+iRxCVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6300 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ashishsingha@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: fnXTqZk3QhVcWjAjrngYEteFx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BY5PR12MB5544E31389E2C71D64A4D3C0BA722BY5PR12MB5544namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=lRgUM0tQ; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") --_000_BY5PR12MB5544E31389E2C71D64A4D3C0BA722BY5PR12MB5544namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hello, Checking back for an update on when this PR can be merged or if there are a= ny other changes you recommend. Thanks Ashish ________________________________ From: Ashish Singhal Sent: Saturday, January 6, 2024 5:53 AM To: Kasbekar, Saloni ; devel@edk2.groups.io ; Clark-williams, Zachary ; Jeff Brasen Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thanks Saloni. PR for getting this merged is available at https://github.co= m/tianocore/edk2/pull/5150 Thanks Ashish ________________________________ From: Kasbekar, Saloni Sent: Saturday, January 6, 2024 1:31 AM To: Ashish Singhal ; devel@edk2.groups.io ; Clark-williams, Zachary ;= Jeff Brasen Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Yes, SetData does reset the previous configuration. Reviewed-by: Saloni Kasbekar Thanks, Saloni From: Ashish Singhal Sent: Friday, January 5, 2024 2:34 AM To: Kasbekar, Saloni ; devel@edk2.groups.io; Cla= rk-williams, Zachary ; Jeff Brasen Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default I do not recommend doing that. Setting policy via SetData does enough to wi= pe out any previous manual configuration and that is the goal for reset to = default. ________________________________ From: Kasbekar, Saloni > Sent: Friday, January 5, 2024 2:30 AM To: Ashish Singhal = >; devel@edk2.groups.io >; Clark-williams, Zachary >; Jeff Brasen > Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Makes sense. Should we also set IfrNvData->DhcpEnable =3D TRUE when updatin= g the Policy then? From: Ashish Singhal > Sent: Wednesday, January 3, 2024 8:52 AM To: Kasbekar, Saloni >; devel@edk2.groups.io; Clark-williams,= Zachary >; Jeff Brasen > Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello Saloni, Thanks for the feedback. After the reset, or when we disable configure from= menu, GetData returns policy to static as the enum value is 0. However, se= tting value as static does not have any benefit as it forces to reuse the o= ld network settings. Using DHCP really mimics the reset behavior that we se= e without any configuration done manually. Thanks Ashish ________________________________ From: Kasbekar, Saloni > Sent: Tuesday, January 2, 2024 1:47 PM To: Ashish Singhal = >; devel@edk2.groups.io >; Clark-williams, Zachary >; Jeff Brasen > Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Hi Ashish, + Ip4NvData->Policy =3D Ip4Config2PolicyDhcp; + Status =3D Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we=92re assuming IfrFormNvData->DhcpEnable is TRUE. Should we check it= before setting the policy and calling SetData()? Thanks, Saloni From: Ashish Singhal > Sent: Monday, January 1, 2024 8:48 AM To: devel@edk2.groups.io; Kasbekar, Saloni >; Clark-williams,= Zachary >; Jeff Brasen > Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking again for some feedback on this. Thanks Ashish ________________________________ From: Ashish Singhal > Sent: Thursday, December 14, 2023 4:42 PM To: devel@edk2.groups.io >; saloni.kasbekar@intel.com >; zachary.clark-williams@intel.com >; Jeff Brasen > Cc: Ashish Singhal = > Subject: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Exercising reset to default does not reset the settings. Add handler code for the case where configuration is disabled. Signed-off-by: Ashish Singhal > --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config= 2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure !=3D TRUE) { + if (Ip4NvData->DnsAddress !=3D NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress =3D NULL; + Ip4NvData->DnsAddressCount =3D 0; + } + + if (Ip4NvData->GatewayAddress !=3D NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress =3D NULL; + Ip4NvData->GatewayAddressCount =3D 0; + } + + if (Ip4NvData->ManualAddress !=3D NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress =3D NULL; + Ip4NvData->ManualAddressCount =3D 0; + } + + Ip4NvData->Policy =3D Ip4Config2PolicyDhcp; + Status =3D Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, Hello Saloni, Thanks -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113950): https://edk2.groups.io/g/devel/message/113950 Mute This Topic: https://groups.io/mt/103181314/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_BY5PR12MB5544E31389E2C71D64A4D3C0BA722BY5PR12MB5544namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Hello,

Checking back for an update on when this PR can be merged or if there are a= ny other changes you recommend.

Thanks
Ashish


From: Ashish= Singhal <ashishsingha@nvidia.com>
Sent: Saturday, January 6, 2024 5:53 AM
To: Kasbekar, Saloni <saloni.kasbekar@intel.com>; devel@e= dk2.groups.io <devel@edk2.groups.io>; Clark-williams, Zachary <zac= hary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default
 
Thanks Saloni. PR for getting this merged is available at https://github.com/tianocore/edk2/pull/5150

Thanks
Ashish


From: Kasb= ekar, Saloni <saloni.kasbekar@intel.com>
Sent: Saturday, January 6, 2024 1:31 AM
To: Ashish Singhal <ashishsingha@nvidia.com>; devel@edk2.= groups.io <devel@edk2.groups.io>; Clark-williams, Zachary <zachary= .clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>
Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default
 
External email: Use caution opening links or at= tachments

Yes, SetData does reset the previous configuration.

 

Reviewed-by: Saloni Kasbekar <saloni.kasbekar@intel.com>

 

Thanks,

Saloni

 

From: Ashish Singhal <ashishsingha@nvidia.com>
Sent: Friday, January 5, 2024 2:34 AM
To: Kasbekar, Saloni <saloni.kasbekar@intel.com>; devel@e= dk2.groups.io; Clark-williams, Zachary <zachary.clark-williams@intel.com= >; Jeff Brasen <jbrasen@nvidia.com>
Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

 

I do not reco= mmend doing that. Setting policy via SetData does enough to wipe out any pr= evious manual configuration and that is the goal for reset to default.


From: Kasbekar, Saloni <saloni.kasbekar@intel.com>
Sent: Friday, January 5, 2024 2:30 AM
To: Ashish Singhal <a= shishsingha@nvidia.com>; devel@edk2.groups.io <devel= @edk2.groups.io>; Clark-williams, Zachary <zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com&g= t;
Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

External email: Use caution opening links or attachments

 

Makes sense. Should we also set IfrNvData->DhcpEnable =3D TRUE when upda= ting the Policy then?

 

From: Ashish Singhal <ashishsingha@nvidia.com>
Sent: Wednesday, January 3, 2024 8:52 AM
To: Kasbekar, Saloni <saloni.kasbekar@intel.com>; devel@edk2.groups.io; Clark-williams, Zachary <zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com&g= t;
Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

 

Hello Saloni,=

 =

Thanks for th= e feedback. After the reset, or when we disable configure from menu, GetDat= a returns policy to static as the enum value is 0. However, setting value a= s static does not have any benefit as it forces to reuse the old network settings. Using DHCP really mimics t= he reset behavior that we see without any configuration done manually.

 =

Thanks=

Ashish=

 =


From: Kasbekar, Saloni <saloni.kasbekar@intel.com>
Sent: Tuesday, January 2, 2024 1:47 PM
To: Ashish Singhal <a= shishsingha@nvidia.com>; devel@edk2.groups.io <devel= @edk2.groups.io>; Clark-williams, Zachary <zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com&g= t;
Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

External email: Use caution opening links or attachments

 

Hi Ashish,

 

+    Ip4NvData->Policy =3D Ip4Config2PolicyDhcp;

+    Status        &= nbsp;   =3D Ip4Cfg2->SetData (

+            &n= bsp;            = ;          Ip4Cfg2,

+            &n= bsp;            = ;          Ip4Config2DataTypeP= olicy,

+            &n= bsp;            = ;          sizeof (EFI_IP4_CON= FIG2_POLICY),

+            &n= bsp;            = ;          &Ip4NvData->= Policy

+            &n= bsp;            = ;          );

 

Here we=92re assuming IfrFormNvData->DhcpEnable is TRUE. Should we check= it before setting the policy and calling SetData()?

 

Thanks,

Saloni

 

 

From: Ashish Singhal <ashishsingha@nvidia.com>
Sent: Monday, January 1, 2024 8:48 AM
To: devel@edk2.groups.io; Kasbekar, Saloni <saloni.kasbekar@intel.com>; Clark-williams, Zachary <jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

 

Hello,=

 =

Checking agai= n for some feedback on this.

 =

Thanks=

Ashish=

 =


From: Ashish Singhal <ashishsingha@nvidia.com>
Sent: Thursday, December 14, 2023 4:42 PM
To: devel@edk2.groups.io <devel= @edk2.groups.io>; saloni.kasbekar@intel.com <saloni.kasbekar@intel.com>; zachary.clark-williams@intel.com <zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com&g= t;
Cc: Ashish Singhal <a= shishsingha@nvidia.com>
Subject: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default=

Exercising reset to default does not reset the settings.
Add handler code for the case where configuration is
disabled.

Signed-off-by: Ashish Singhal <as= hishsingha@nvidia.com>
---
 NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config= 2Nv.c
index e0b6a4d4a9..dac5817b7c 100644
--- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c
+++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c
@@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData (
   }
 
   if (IfrFormNvData->Configure !=3D TRUE) {
+    if (Ip4NvData->DnsAddress !=3D NULL) {
+      FreePool (Ip4NvData->DnsAddress);
+      Ip4NvData->DnsAddress   &= nbsp;  =3D NULL;
+      Ip4NvData->DnsAddressCount =3D 0;
+    }
+
+    if (Ip4NvData->GatewayAddress !=3D NULL) {
+      FreePool (Ip4NvData->GatewayAddress); +      Ip4NvData->GatewayAddress  &nb= sp;   =3D NULL;
+      Ip4NvData->GatewayAddressCount =3D 0; +    }
+
+    if (Ip4NvData->ManualAddress !=3D NULL) {
+      FreePool (Ip4NvData->ManualAddress);
+      Ip4NvData->ManualAddress  &nbs= p;   =3D NULL;
+      Ip4NvData->ManualAddressCount =3D 0;
+    }
+
+    Ip4NvData->Policy =3D Ip4Config2PolicyDhcp;
+    Status        &= nbsp;   =3D Ip4Cfg2->SetData (
+            &n= bsp;            = ;          Ip4Cfg2,
+            &n= bsp;            = ;          Ip4Config2DataTypeP= olicy,
+            &n= bsp;            = ;          sizeof (EFI_IP4_CON= FIG2_POLICY),
+            &n= bsp;            = ;          &Ip4NvData->= Policy
+            &n= bsp;            = ;          );
     return EFI_SUCCESS;
   }
 
--
2.17.1

Hello,

Hello Saloni,

Thanks 
_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#113950) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_BY5PR12MB5544E31389E2C71D64A4D3C0BA722BY5PR12MB5544namp_--