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 ED2BE780091 for ; Fri, 5 Jan 2024 20:04:50 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=/afDMmXtHZbfzMuEOBR0y+ITx4UF498vGQKr1WS7WkU=; 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=1704485089; v=1; b=aB4FcBB2bHo6hQ/4RwsWZP3y1ji/s+OF+O3+yrAWqK5YdwZJl6gVmwBgfhsTSmanWPdxvA6k sdWERebWSpjOTAYpdJ8EZQFvc/n/6E38pQdSl3LsBKDVoLNDhmZ1Yd6dkWr+PnjVJGg8oCJ5Y5Q LMwz6OZBHriNBNUH/UPA0hMo= X-Received: by 127.0.0.2 with SMTP id PuOjYY7687511xglDloHRDij; Fri, 05 Jan 2024 12:04:49 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.33348.1704485088602157274 for ; Fri, 05 Jan 2024 12:04:48 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10944"; a="400332652" X-IronPort-AV: E=Sophos;i="6.04,334,1695711600"; d="scan'208,217";a="400332652" X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 12:04:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10944"; a="846655583" X-IronPort-AV: E=Sophos;i="6.04,334,1695711600"; d="scan'208,217";a="846655583" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga008.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Jan 2024 12:04:19 -0800 X-Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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; Fri, 5 Jan 2024 12:04:16 -0800 X-Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 12:02:02 -0800 X-Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 5 Jan 2024 12:02:02 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 5 Jan 2024 12:01:47 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YmQhqZWVInCQ29f45M2IepKgtdCB61k4UDBWnyU8jtn/s3/6l/6SsioyFdv4aiP5U7qxo9jsy3+Ob/HNvVjOq0muMcW2mW6KmV0XEuk4sOr1KkFl5klCWG97+3qDyVQNFDX5k0jPhUniekCVw8AVeFwZCfE6mzivqBvfwVRy7HfAV/0aiNWZrWOYX+GB/5tpmhCwF9WXw904o9oWqbHOBZcrh+FvJJ0TvucTX4ExAM64yJdynEOWZqp8yF3/CUufx1Q1w3gE7aOGducjITppo+l+CMlv8OCRShhF4A0HQ5etAgUifK6m5MTTYNeUuHV/sNk2nmaZzjTHSgjZep30XQ== 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=TcnMcsc5EoNvn7dLvCJV8ESX3s/VhutK8734+CWbRMA=; b=RD8GXSpO8LJDZTOYnRXa1rdWpthtGi5urcmew1reethfNvjMS8uUKRBaOCt3TtkqL66qViQsJWk6aGRQ/bbm+WOjUKuiZmdNMaBa/HAF3srMxnNam3dsUXk/hGegMT2kpxQOGdoq47Z4XNGqYYyqx1Tq8lergcfz/jvTzC8ZDNqraB0dQkPfZt1xUSYzM4sv6+/2BUIP+pkd57BDdfTTRRt5BcDplmXsVMFsfmsDJte+WvEN9aIIdN/0nOgQm5kjxhyTLOoWweNssoJLTGu439u6W424UwDPakQtuM9X1Z0LuHDgo3qi21FSIpCoQsVj1+7LwmTjfMmOqk1YdYqqeQ== 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 DM4PR11MB5535.namprd11.prod.outlook.com (2603:10b6:5:398::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.16; Fri, 5 Jan 2024 20:01:39 +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.7159.015; Fri, 5 Jan 2024 20:01:37 +0000 From: "Saloni Kasbekar" To: Ashish Singhal , "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: AQHaLudCf7lKpF50okeBHSbBHqEtirDFRqgAgAHTQECAAVKCgIAB16wQgADjfwCAAJ5GsA== Date: Fri, 5 Jan 2024 20:01:37 +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_|DM4PR11MB5535:EE_ x-ms-office365-filtering-correlation-id: 81252e8d-65c6-4d87-b86f-08dc0e29202a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: jE0aNQ05OGQsD031q/zBB54g4+VqNQfAHkZAEOE+i5wzfRDgut5RpiYb/27f6Biiqmjkqmoc+kv5D/vGOgAZKOvNysJ4Ev8VcbFJE6D8SWsWKCuuSinhuT2KjRRqwqSkMQZFWfr7svfFSYzjQWgsnYyiNU5RgMhi0q+TaXSeoaI+JsLlQ94ZMgeRQk2iWFlPyJ2TBP0gbx0LjDoHpesV0TSCTpZT5dDoQvqZa7tHJ7Cr59e7qX6dGAzl6JmjCegRRsJ3slIKucE/SJn9viKClk+pdGXUrcPojBpSp657nK6fNf48W417TozS8/daG4lLrBVZfmep8FJDRKatTr2nYdNmsL+PWK9ms9ljFch3odBQ83xWbLEQgK5azPc19OfKNQl7It6vRE104hIssyab6suvlYxZhJRWRQlq0b4K2kEqLyaQmeLT6SiGeL0SQIcQoREP1UHGSUrnZHQwNgfAnszSbX77O0A94vP+TwTHRGz4+bxyN7IhtjOSwxNAcH1RHX2JYNSxeYLsQz2UF7eSguE3mlTPmO5BmL1Yf6LO1UEEH1d56ujLSmuvwRXn3rPxF6Yr3NXkVz6eTVLyxzzCeBgADacp7WOTcfc000B6bQqPpWakcDGzJyiF7B+P0isExFBwFIDpWyWryW7L/SYtpvbq1qSI/0RRCndIK7GQHT0= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?YPEoRV8UcPZC+N+veNobeJ1J+aNgprM+FKmZilumQQ02A6qSqDbIf6J2HPhF?= =?us-ascii?Q?kMMFExvITLI6V3wDOrsnsb7tJ8/QInqwt7+rADm+9SUpKzjTBJOKT57PB+rB?= =?us-ascii?Q?v85yVaabWCso803ZmwFdv7K7tJCSy4t4rT4orJNvzP4pGcUzQm4zyFtzyHl5?= =?us-ascii?Q?BhMuZjukmTmylem+gep7qKC2MmDl9XcF1ELGlgoaORZXoM6PLKkKeLbbbp0a?= =?us-ascii?Q?N4jxmPCfsXUXsiVHncUXzS0Co/tV2AiZo+Ddt1A545HCl/XWunE+rvtknrWf?= =?us-ascii?Q?WHhQ/UOidB3ch0W5Yfl4kZmYkEM4bSMoNczPClVpsZQBb5sER93z3jzt6R7V?= =?us-ascii?Q?OG1n/bYiQykrKTkJab/0PDB7JnyFwngDrPt9ISsMkP7uNkfOKYOEjCWBNfYY?= =?us-ascii?Q?L7Uc0oMwQyI7DpAdodPHRRjBaVAlNKwBq/fF0ZdELl8KYWM51QbgxTHcLpWO?= =?us-ascii?Q?IFsPm8cXycv13bAxzigdh8cbEPKoWBDqKr9PDcJT+wSuGK28IGasM0cSlREj?= =?us-ascii?Q?Fyz0Fg1XZO5kGTNobJLd5w9OSfLqOUgdstF394uzywpLw/yyVZ0FpEGpX7ur?= =?us-ascii?Q?n/yHBzvRfb2rkZVZLKmRH/De2tOI6U8+UApzBkjJ41zJnOMbPpabBUWJEe7+?= =?us-ascii?Q?Nm2rtQveh7SuB5cSJjdfyXl11UonKXpRC5F34MpD+uwxKkZ3syk5yDtJvnA8?= =?us-ascii?Q?St/fbsxEdI6vyQjKwSatqb91bJDuOe9kec0uZo+sasRkMJHVZioXJ2N1U5Iy?= =?us-ascii?Q?W1b+RXJeJcZAJGVHQxTLQ5RhCZ5UU42A9W239ac9L/ibzgX6D5Oz+JBf01k1?= =?us-ascii?Q?vfAQyMaBsLf1Is2GsRMoRbBtTZUGUQzMA2BAZ9s3xWzuChocmbcE4nHBigk3?= =?us-ascii?Q?EL9do97auHo3a7IaTkAmlQJkUt5w/7zUSL5k6O/plqgsBshkJt5xZaroxb86?= =?us-ascii?Q?U3/2GHu1ciWxkQFSbvs5w+Hf/5y25bMQFcxTwxOBlWQAgKWjmGH5eNGOs10R?= =?us-ascii?Q?yxf8HcaUvWxt3bMtUXmHT8ExqBfbcU+Y4C+MmC3fEFd/alnZqgakaFCNsnMz?= =?us-ascii?Q?hJa1EmwFx8Vq1erhVdmSBXkCDJilQBvoX+5LhQdM/F+Oa7K+PzsoGwiIK2B6?= =?us-ascii?Q?bQSWUIXHVtKPyDgFSdOLva+GlTrd4ehEv2YIgUFbF+TJY1YACYCAM0O8Dhb8?= =?us-ascii?Q?Euna6auBCJ8XCjmwoct5iqb9jlhW32qzJr2RikW+FqtuVVg38t1+Nb2dy8Gs?= =?us-ascii?Q?ieFusMm69Wsunl9vISS6GBhT4aFbEx83OZCgo9b62nbOt6rZg1QmEOE9D+/b?= =?us-ascii?Q?r+E+OAVVDop7LFHgHPvGAlWWQfr/uFYZmT9IPsnDvm+8NZ9vEj/Rx00WPUjw?= =?us-ascii?Q?yt7PV+wpG/oIsLby2N8iixN0Sw6me096fu/aOboahA3vcxzsUWRFTT/oQ64F?= =?us-ascii?Q?03QlfGlcZ1wcoI51U4nmIgUGXVEH3UMmZAkMMhIex80nV9qk1/RLIKa6o6AK?= =?us-ascii?Q?PkXcnN99VVfjQQG6aGYjXM4LflgprnMT63Bomp+E1vYOCQ19Sd+JLsgH8yNw?= =?us-ascii?Q?rVaBmw5+qhl5fc1Sg8OlWHLC8oijX+wVO21mTPCT?= 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: 81252e8d-65c6-4d87-b86f-08dc0e29202a X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2024 20:01:37.5856 (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: USvJyik4CIPPl8mQbrimVZFLnGtOSIV2MFiz6Z7heuuMD3+InxERoxaVqxdhEVhEq7VhuqYJjpN90YrSpZEB0za9ZydgT9pKYwLPCkcr9aA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5535 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: EZsG8fx7EIRIuyDzuEPYf6A4x7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_SN7PR11MB8281D9B5FC21506EC4956E07F1662SN7PR11MB8281namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=aB4FcBB2; 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_SN7PR11MB8281D9B5FC21506EC4956E07F1662SN7PR11MB8281namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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'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, -=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 (#113318): https://edk2.groups.io/g/devel/message/113318 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_SN7PR11MB8281D9B5FC21506EC4956E07F1662SN7PR11MB8281namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Yes, SetData does reset the previous configuration.<= o:p>

 

Reviewed-by: Saloni Kasbekar <saloni.kasbekar@int= el.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.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

 

I do not recommend doing that. Setting policy via SetData = does enough to wipe out any previous manual configuration and that is the g= oal for reset to default.


From: Kasbekar, Saloni <saloni.kasbekar@intel.com>
Sent: Friday, January 5, 2024 2:30 AM
To: Ashish Singhal <as= hishsingha@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

 

Makes sense. Should we also set IfrNvData->DhcpE= nable =3D TRUE when updating 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

 

Hello Saloni,

 

Thanks for the feedback. After the reset, or when we disa= ble configure from menu, GetData returns policy to static as the enum value= is 0. However, setting value as static does not have any benefit as it forces to reuse the old network settings. Using DHC= P really mimics the reset behavior that we see without any configuration do= ne manually.

 

Thanks

Ashish

 


From: Kasbekar, Saloni <saloni.kasbekar@intel.com>
Sent: Tuesday, January 2, 2024 1:47 PM
To: Ashish Singhal <as= hishsingha@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 = links or attachments

 

Hi Ashish,

 

+    Ip4NvData->Policy =3D Ip4Co= nfig2PolicyDhcp;

+    Status    =         =3D Ip4Cfg2->SetData (

+        &= nbsp;           &nbs= p;            &= nbsp; Ip4Cfg2,

+        &= nbsp;           &nbs= p;            &= nbsp; Ip4Config2DataTypePolicy,

+        &= nbsp;           &nbs= p;            &= nbsp; sizeof (EFI_IP4_CONFIG2_POLICY),

+        &= nbsp;           &nbs= p;            &= nbsp; &Ip4NvData->Policy

+        &= nbsp;           &nbs= p;            &= nbsp; );

 

Here we’re assuming IfrFormNvData->DhcpEn= able is TRUE. Should we check it before setting the policy and calling SetD= ata()?

 

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

 

Hello,

 

Checking again for some feedback on this.

 

Thanks

Ashish

 


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,

_._,_._,_

Groups.io Links:

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

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

_._,_._,_
--_000_SN7PR11MB8281D9B5FC21506EC4956E07F1662SN7PR11MB8281namp_--