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 A2428AC1221 for ; Wed, 17 Jan 2024 17:27:27 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=2digskAU4DN0d5I5lQQXFiuUMLsKBdLVOc7vZakM6C8=; 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=1705512446; v=1; b=gVFkTXX9jt8t6rCV7TYRNJ7LgQrjl85XoL0bhOkTShYVe5Gso7JcEkjDIBTg8e8ixI80zLBq YqAqy1UqB8g+DXaDx8UhBuAg1lz2wZN4pzCVm43RboUxup/V2HuQMCJ6RvJWK2orkHL8yWmJspC 5kMqQwWlvmZpiGHzWYWz2pRw= X-Received: by 127.0.0.2 with SMTP id feq9YY7687511xnSncE6pUD6; Wed, 17 Jan 2024 09:27:26 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.9453.1705512445201627382 for ; Wed, 17 Jan 2024 09:27:25 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10956"; a="486378631" X-IronPort-AV: E=Sophos;i="6.05,200,1701158400"; d="scan'208,217";a="486378631" X-Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2024 09:27:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,200,1701158400"; d="scan'208,217";a="84967" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa005.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 17 Jan 2024 09:27:24 -0800 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 17 Jan 2024 09:27:24 -0800 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Wed, 17 Jan 2024 09:27:24 -0800 X-Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.41) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 17 Jan 2024 09:27:23 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hn8eOA6cnANnoB15II0whx04FxA3caLOPZl3JkrFPepKqRmzl0rojgH0tKIpazeBViaoI3dB+lH1QW4oyqtvZpzwzu0J5HZYSWCT30mWXtW/h2kmjE4FI2Zl6ikQrDAqlh803dlUDjtJ3GvwMEXcJhRScere55uXPkF8lGxqobi5JMijJpj+/P4L6VQa1tgZFqOxHFQ/jnvifqQjFndfjIKW6OuBV5yVjyNdpmz1WX8R2PTHZzY4DP30n0bIWgF8pntvHK6kQxoJ1WyQWBUtr3+1nu7GP8S2WtOzcsV+inXgTdKxXanjTBa/6xnSvbyXSPMi1v2ULkj4WfsMn8EF8g== 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=nhwPFr8zlnlyCZk+JkC4lnFcZU2+OOXeFQ/AaUWL+FI=; b=cUunKzM0mVR8ordUVOK2XI/HpXQNR4IZsWMdrHxTt8S87SaDBGkOPtJ2hAZ9Yr+eAyDFpXob9wlbQWYaviAatu0xAdBiAiYAPOurd78qwwnvklTj0pyljj9ShacnRSDnrY5wmienlVLUbOR9c9jR6w2zWJ9jqbzzQToIUgeOAflexts93Ck3tFMqtp2GtV/6ja15nyc9SGNlBbLNFIU/oUQei0e4kI/w16rCLKaZtpHXsIj/xMiUh/JLMGCrWy5flLheMKe+/2oWGTK6mNIqFkyAmxmzDTN8Gb6+YpclKnVpqUVREBZrSJ8/+qGr1gN+aLVggDbg0TrJmiL79PpO0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from SN7PR11MB8281.namprd11.prod.outlook.com (2603:10b6:806:26b::20) by MW5PR11MB5810.namprd11.prod.outlook.com (2603:10b6:303:192::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18; Wed, 17 Jan 2024 17:27:19 +0000 X-Received: from SN7PR11MB8281.namprd11.prod.outlook.com ([fe80::d2a9:6c81:214f:f89]) by SN7PR11MB8281.namprd11.prod.outlook.com ([fe80::d2a9:6c81:214f:f89%7]) with mapi id 15.20.7181.022; Wed, 17 Jan 2024 17:27:19 +0000 From: "Saloni Kasbekar" To: Ashish Singhal , "devel@edk2.groups.io" , "Clark-williams, Zachary" , Jeff Brasen , "Kinney, Michael D" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thread-Topic: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thread-Index: AQHaLudCf7lKpF50okeBHSbBHqEtirDFRqgAgAHTQECAAVKCgIAB16wQgADjfwCAAJ5GsIAASZsAgBIv3ACAADdZ4A== Date: Wed, 17 Jan 2024 17:27:18 +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: SN7PR11MB8281:EE_|MW5PR11MB5810:EE_ x-ms-office365-filtering-correlation-id: 8d639743-7904-4492-2b7f-08dc17818e75 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: F+qj4b9z4ci2TgU/PSRUwENwrSbHpvjqOBf8nvpeRIFlmV7IPETgK7ex0NhZ62YTo/VNAV2Cg6/TVqKyZ/ta6LeNb9es+abb2GxYa+lf6FayPROzFm1pfsTnABG1V6fZpVUFNKDerbRIwev21P8rBno8mJi45Iyn5bsbLphqmSKE5ShG6zS8UO2utqiU3VbGuJC8xrwLprQIgPvBEZupk1jPX5NT9hcPfDmgu1LcRddtRxEBlUCnn6ZxK6n6jveR8FrRs2HCAvWHQJmqK1BjVEv5nvgI1SapYM5e1F1a2ai9XNboqdnqpB0HJZYsutm3kNRnlE2Dt/pneVzDEa7fDX1E9Bt9ORteXHXrX6/gSdjxKvfbva7MVdXnIFi7xpw44/bOnTw1kayLS1uXApzrUNchAPvhyPp3q/Sh5hxeuAxO3NQKKS04Yy4/YExkmUow5RlZffDtMJWq34HVuLd6DzN4ssDd/qC5QL5bIYWy+OqXpkQxbhcdLx0uocSja6QwhxyhQurdNDaSi8bYPlVnTto8PqPYsyLigL6qVbm24K5FHso4y153NDpcZjAqsQuuK5W+tKWMByjRdnYJvHGZUql8YP2ZuztA5BWE7kdYdMi6XJeqUApG3nXQrqH8+q5tvh2nDekZ70RW13/7xyNKfw== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?AseT6Qsoz/eDRXxwAbcSI+b2IwT3sWmcoDnrWewQTalgCDHHR1eR1CADK+Kk?= =?us-ascii?Q?6AvJqbi5SWpydTDFKCqu/1TzCZYtppY+9Mfp/ZRaEpJG0NaAVpuJ6+6bebYj?= =?us-ascii?Q?4kzJS9SBqkQY9TG75MeWmrr5fhQoDatEMhyKPTP9YKpy8bnnrIFPMAIz8DoK?= =?us-ascii?Q?FEOmvBKGabfsQD5GEBcsMfP9H0z319srb1s3HzhZsVICgrEd2CIEFMuzIHId?= =?us-ascii?Q?dd7+/ntVEDZrwRboKgh4PuwGsXBRT6I12EdSXU3/8XsehkCFHAIxRFzAPmOU?= =?us-ascii?Q?1SW0CfqyNxbNjGfLUjeCt6eZff9IF4oE0BHTpGOKkemnF/Oeg1NGXZ6rg8qN?= =?us-ascii?Q?82NY5aTaU8lBSq6URx2RBP7a1Px9PGhKe1ZzG5YLYsdEN4Q9+TNRRvfgrNgZ?= =?us-ascii?Q?tD9aoIEG6gFoNxlYqyrf2DYd+q2tdD6LKX9aQi4HscTjIpYEuz/ntv1qdcZC?= =?us-ascii?Q?5GtnxopOn0CKgr/du1YdoT1i9ce4o7f7Coma+pYh/1rQATqLIhh/UPG1ZAQL?= =?us-ascii?Q?X/IOPpuZ3Zo904UMNP7dWNO+IYogNAOSHhMyBrxOrz1p7GNTLk7O14FaD0Sn?= =?us-ascii?Q?OsvKbaWjp8NU8g6953PSGypb+W5NZIZfGNmmCbebakj60iy+xhFL8I1+K7cu?= =?us-ascii?Q?TmguN4u6uCfQ0ERPFhPgqkwbnUN3PQ6eDSzQpZJ2IqcYe4ESvb6D9eudqS9o?= =?us-ascii?Q?RuTf0O8Awe+94alYsdK9QHJ3LnyYoC/EhsDuDiyPCN2m54Vt/FgMqTvX5hPE?= =?us-ascii?Q?Qv2RWdV1PlGKyeuz51aVR8b5vdrBp65f+RyiMSfoxSwMaqI01Ia3XQ/jwdrE?= =?us-ascii?Q?shI8hTd3dOyNZoNsSrwUtv6ugtdWPzP4/gUsf1ID0l9x+gzjz3RPuOG0x6fQ?= =?us-ascii?Q?lmT2tHbh9ezJukvF/mAuWV8ATKfcO2aY8IOfUOe3bwKXs9C/svnOaAOdXyZx?= =?us-ascii?Q?bAzajn0SmoUZokM8SnZ83ZxdCNRxm0Ml8MgQ6BLLPPugP3GJw7QjF9lJJ6jV?= =?us-ascii?Q?gr7K4UZrZ7gZUTFvjhF7ahEjqqDiu+sUSkJemFFkQeZzp7Jb+DuUq7YGQZwc?= =?us-ascii?Q?3rQ6pCYp69T/GG9e3KGxq0QsSeLriaYF/u/dk6Kktuw0wPK4RGgx1v74tcrb?= =?us-ascii?Q?CFZ585yECFu9gSS4GQ0fEE1J9PcwJC1hYO1W23NJwfEuhHni7bmjA3qf+HI4?= =?us-ascii?Q?esfZ7XSXwAbQOYKMn60bEyX1pK4Npa1qNSEJj6blD3vP/sRfdFjU117HqHA5?= =?us-ascii?Q?eA4CjWLoF8JO5CMX2RzD25w3nKSoRmbKj8kAPR/EdT+YBgolqnw8RV//nvFJ?= =?us-ascii?Q?tl7RlRTEn/Q7rjeJU+m7/WXAloXP7cjt/aMBjgNHYYwMJgsNtXnkceh0Xflm?= =?us-ascii?Q?DLnKKargJgZjcqwCjlalVTUrb/NPahKRGGfHj0pVphaphv3pvWi4jpP7zHME?= =?us-ascii?Q?YupwGWH1U3IKp4f22i0R+0esxBodjuEUwnPvjZOLYLI/kyDP2cvsJtGwYJLW?= =?us-ascii?Q?aFQCkS6EKXXn6Z7v8TguyUtJemy31wc2WhE+U8tRW/XVzsINJzNAa3BJj74J?= =?us-ascii?Q?GwDU/U2zbFnpiFt1ZDVJLRVeQci7j0oAKlCn2ARV?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN7PR11MB8281.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d639743-7904-4492-2b7f-08dc17818e75 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2024 17:27:18.7862 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fbHVIfycvQa9t4TnwYJ/HrM3MDjUIT9jBPW62Btpnz6euZV1Yh9vxwC+US2oQoWvBC2pKEImojd3AAgEn1iZyekN/1mVLAO6noxfZet0zdo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR11MB5810 X-OriginatorOrg: intel.com 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,saloni.kasbekar@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 5TcK2wKbuNDI0fOcbUQKNIpdx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_SN7PR11MB8281D00A375439702CBEDE32F1722SN7PR11MB8281namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=gVFkTXX9; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=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 --_000_SN7PR11MB8281D00A375439702CBEDE32F1722SN7PR11MB8281namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Liming, Mike, Could you please help merge this PR? Thanks, Saloni From: Ashish Singhal Sent: Wednesday, January 17, 2024 6:08 AM To: Kasbekar, Saloni ; devel@edk2.groups.io; Cla= rk-williams, Zachary ; Jeff Brasen Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 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; Clark-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're assuming IfrFormNvData->DhcpEnable is TRUE. Should we check it b= efore 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 (#113956): https://edk2.groups.io/g/devel/message/113956 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_SN7PR11MB8281D00A375439702CBEDE32F1722SN7PR11MB8281namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Liming, Mike,

 

Could you please help merge this PR?

 

Thanks,

Saloni

 

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

 

Hello,

 

Checking back for an update on when this PR can be merged = or if there are any 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@edk2.groups.io <devel@edk2.groups.io>; Clark-willi= ams, Zachary <zachar= y.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: Kasbekar, 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-willi= ams, Zachary <zachar= y.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>
Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

 

External email: Use caution opening l= inks or attachments

 

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@edk2.groups.io; Clark-wil= liams, Zachary <zach= ary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>
Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

 

I d= o not recommend doing that. Setting policy via SetData does enough to wipe = out any previous manual configuration and that is the goal for reset to def= ault.


From: Kasbekar, Saloni <= saloni.kasbekar@intel.com>
Sent: Friday, January 5, 2024 2:30 AM
To: Ashish Singhal <ashishsingha@nvidia.com>; devel@edk2.groups.io <<= a href=3D"mailto:devel@edk2.groups.io">devel@edk2.groups.io>; Clark-= williams, Zachary <z= achary.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 attachments<= /span>

 

Makes sense. Should we also set IfrNvData->DhcpEnable =3D TRUE when u= pdating 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-wil= liams, Zachary <zach= ary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>
Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

 

Hel= lo Saloni,

&nb= sp;

Tha= nks for the feedback. After the reset, or when we disable configure from me= nu, GetData returns policy to static as the enum value is 0. However, setti= ng value as 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.

&nb= sp;

Tha= nks

Ash= ish

&nb= sp;


From: Kasbekar, Saloni <= saloni.kasbekar@intel.com>
Sent: Tuesday, January 2, 2024 1:47 PM
To: Ashish Singhal <ashishsingha@nvidia.com>; devel@edk2.groups.io <<= a href=3D"mailto:devel@edk2.groups.io">devel@edk2.groups.io>; Clark-= williams, Zachary <z= achary.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 attachments<= /span>

 

Hi Ashish,

 

+    Ip4NvData->Policy =3D Ip4Config2PolicyDhcp;<= /o:p>

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

+            = ;            &n= bsp;          Ip4Cfg2,

+            = ;            &n= bsp;          Ip4Config2DataTy= pePolicy,

+            = ;            &n= bsp;          sizeof (EFI_IP4_= CONFIG2_POLICY),

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

+            = ;            &n= bsp;          );

 

Here we’re assuming IfrFormNvData->DhcpEnable is TRUE. Should w= e 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 <zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>
Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

 

Hel= lo,

&nb= sp;

Che= cking again for some feedback on this.

&nb= sp;

Tha= nks

Ash= ish

&nb= sp;


From: Ashish Singhal <ashi= shsingha@nvidia.com>
Sent: Thursday, December 14, 2023 4:42 PM
To: devel@edk2.groups.io=  <devel@edk2.groups.io&= gt;; saloni.kasbekar@intel.com&= nbsp;<saloni.kasbekar@intel= .com>; zachary.clark-williams@= intel.com <= zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>
Cc: Ashish Singhal <ashishsingha@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 <ashishsingha@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 (#113956) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_SN7PR11MB8281D00A375439702CBEDE32F1722SN7PR11MB8281namp_--