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 9D6B3940419 for ; Sat, 6 Jan 2024 00:24:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=GUE1Y40wuwIQwk7UR0Sk9V+nqIKiQgk1Xehi30t4+lg=; 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=1704500641; v=1; b=k+ShugzHSSlUKf00NS9sfhfPrdokI9GBGIBsOajHc6hDTuBiJWcIAzcfi8YqJtJj240oWUTn Ic3WirWynRRmfcmFVDmQCIY2rQ0E6ZWgjr8hOQnBl4NpI+KOVDINXKyp926pv3uqfe0hBmVlBXb YIBKF1NQZxTZKxaprWzHOdtQ= X-Received: by 127.0.0.2 with SMTP id G7dyYY7687511xfLmmvCHSTw; Fri, 05 Jan 2024 16:24:01 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.41]) by mx.groups.io with SMTP id smtpd.web11.39438.1704500640307714287 for ; Fri, 05 Jan 2024 16:24:00 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=liBcQi4YBKuE6HrsS/Wfam09oBRvWs2FOtAIYr2HBwUwCClvylLAOHLEBR9+guL6FaYsRtST5wTTRBaD3MvKRzwiiTE0TlVEeEUPCrUqOzFBhRAH2+MGnDnAYQaPWFKNaxqtBZqOirRN76s7FTOcxI978M3yma0ziq/kSJPwF/Q7dK1o6IUrxHVOehXBMLQ9Ri//yT0P0eYLHzNYGgM83aNasT5ocZXBxamKHyLAFtPkfpzBAahgjF8CMB2bgaAcGFxHRCUJeWsZxCVfjLpxifzhKsjQOAbM2MAtOOXVn+fUbUwzewtpsHIPSQMsb3VilHa+Hwe8tfEhNVJvlM8wZg== 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=HBlpJ6qbvWw59HZydEDwB0heOdOQRKHsyJsSk8IyDdA=; b=LNqi0Zbp1RqsTNm1vwV9Ocu+UN7xYzExrXqnnblHSMqD1JYZzxM/OAuvUxNm+TnhV9d4US6K6dG2PkJgyEnxmw3e7JMicGrTNyWMRgPOT3uplBupeAXWYPFRCW6WPxjmp8cn1+zA5PDALuwQr+sEgwPnscHp+v+d1fBnNmij1ZFCa086egbup7fEBxEQ27D5ghA6tr5ybC2/F79qTQTH9dGljASUGzmyuuti618sSwarAPVV4s4VnO3x4S/c96oa8LcgPBEAjzHQOQxE/lugLjkP6yYs7aeiURI3TAyuBzU3iYfKZlKqN6XChqz+lmTxH9T/1iz0Vgk1j142kJvFDA== 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 SA1PR12MB8142.namprd12.prod.outlook.com (2603:10b6:806:334::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.15; Sat, 6 Jan 2024 00:23:56 +0000 X-Received: from BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::108e:2378:282b:6d89]) by BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::108e:2378:282b:6d89%4]) with mapi id 15.20.7159.015; Sat, 6 Jan 2024 00:23:56 +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: AQHaLuc9P9mSwxDcuUyB3JunDYT5ybDFRozEgAHVYACAATCxsoAB974AgADi4GyAAJ7xgIAASRGv Date: Sat, 6 Jan 2024 00:23:56 +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_|SA1PR12MB8142:EE_ x-ms-office365-filtering-correlation-id: 0899a35a-9c13-48fa-13c4-08dc0e4dc54d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: RaLVzi4es5DeqvrA52huCnU9o5yA3inzr+leoALHHStRUKuHwk7jo7M1GKE2L3kgFZ2pKZr7+PLqViNg/pCSl7YzkA4b8+Okmhl+Kuvv/ini8k9aQVib+flJY0wV5mcD2BK9TctCJY2MbcAE9ZtMn6xrcIaOPDT75AqNYjX3WPzcUAX6kZBzco8/Q1IXk96ACHqA7pMCX6yvDa2GpgwHoWSi8TPT5K4fOieFkoNxihsAhRIo6YMz41FR77gl+n3fkeOTbkbpHsPiiLd9M5G78GhjpIl00TeX5BVQzdVIcyI4N3OXpzSceCd6mywGHWR1ISeKA/NIMtHjUbdo9k4cqnU0f004vfy/uUgABeaiwwDwGULfYnAUcnAc7/w1gUoPXG0yaQXP22MP1IyAVcZSDuPW16K6JFSo3ZItOX8sEV4sG1f46aqA0Ab1H5WHyt0uppCyd2gmzX4Y9HBh56NsRfCacUDyWKLdGTrNB13rUIJ+oGaWo/IR1IeDfJhSx9pun08PFtOaiHvheYJhx1N1MbEVavl31IHTI7ncBnkelg/RoLE6J7Zzz0hVv09duCgMVJDTuaOBmbatBd6pIJENVoI9zU4i7WtGylYeVPZSMby0UY12BP78TJdYz0FhDHGJUBSozWWfdop4EWwCezMUKQ== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?GtIxwwI09zhBRTPX5K6w9v/Iiz+YYF9uKrnfnRqWWdV8y8XZdkpCthnB?= =?Windows-1252?Q?HYGjgwWTn+J+BbtccTJ/xVFOoUVkaSbs8RHgYj3bkNxC4KlxaTCwYRBu?= =?Windows-1252?Q?pVY60pUchuo7FSPNFk02jpC9e9leMm4cxdA9mLyvGBBMmmQaw/E+SAgA?= =?Windows-1252?Q?JqX7vDshfj4aIiYWChJZbw1x9Gzf3NxLygjmzM6N09c0X0+d/2CitHbn?= =?Windows-1252?Q?EcIAW480BIEEJSL2iZ5Wx+dmPAU7Ov5lNDpWm24p98NXre1A+t/ubwJi?= =?Windows-1252?Q?Xd3FHZc0D6NhknLYKC31pRWueJJFfmMdXGkVXKVSfvZgvpDM06+T+gq4?= =?Windows-1252?Q?Qzd0XAbfeiM9K6oaHIQuQcT9wUBGyvDop8dDVFjkxgC06XC947XcZCt5?= =?Windows-1252?Q?Bpe2nCAei/c2FqUOUr9HFwpZzHedUDsHfcABYEz7vqWjUwWP1lXBbFRA?= =?Windows-1252?Q?U27wYj3hNtcKiCaxso6Rr2Or/XCk/p5bRIBrSpm+nreefoRi1ENcI/yW?= =?Windows-1252?Q?IS3E3WyT3o8BbooS5CR+NkbjD4fTKEHjh1KaP3QBcmQeCVDqwzuwngFU?= =?Windows-1252?Q?S8y1Jnu3Vum6l754Z8jz/tVu+00eu0gY47T5yh137yQ+noMWUcKQ20fw?= =?Windows-1252?Q?xFJnbEG+fWAxJ6SUh6QBSZ+RPA0A27wTh/jT/1H/doAs9lDu/qcPfpFC?= =?Windows-1252?Q?McZiRf6nM7Lz/kfAffRcOohcdY+xovNZTtWGCNXzFNLj4/SfPmqXHq1Y?= =?Windows-1252?Q?p3xnKpQuwF4dlSH1LugCPK5GKLj5KWeHDQuJYzW6bFnITRz/xpHyN+NT?= =?Windows-1252?Q?MTjawqsA6nAo8/PI8aTZBi3uSkYacNx5HIRYw38UkdJ1mnWgv1NlCeMN?= =?Windows-1252?Q?1PFE1K5cIMzTOdoHYDvpfYlu2B8OxQkJaxVzlpnDnX2H5tW7+v2yLCEm?= =?Windows-1252?Q?NrkH57FYQSYQ3FE+rF03MZacebo2zVBP0WilYE7PhWUCKhUop4bPkvQC?= =?Windows-1252?Q?70JIHG823nTqjUteXZfFQRIJsGomctHgQYZyddYfF0VCkVnV744O8T51?= =?Windows-1252?Q?BuGXQzI8CBAdsouqw8Jt62TYk0f599B4F66ovy+myl96mwUVGpS2zNpG?= =?Windows-1252?Q?SPlYlhGl2NoUsCqx5VHaKeHPJlc+FsA8ALJe9/aBxHUeplriocNgzOvi?= =?Windows-1252?Q?RkVFiuqefIG4KFm9p6l7wcb8imQ1pxmNgyH+a0O1Z/Qo7IQ2bcPy2Ute?= =?Windows-1252?Q?ZkdSZBuxYJwQqYyNLmcRtTT3mfMchfI+yuSRJUfbTFWoaD6smxPBlJcM?= =?Windows-1252?Q?CC/P33njJgEanqVok1NBJ/WeO2AgwNBcj29jqo+7qT5vY0ewGssLdV0Z?= =?Windows-1252?Q?98caYLCrfQFQS0AT0A93HXO4xoM1KeLbvmK+6aUzM2oECrbzbbLVnRoA?= =?Windows-1252?Q?BO77CR9jwOW7IDD8TURs8PYzKVVZo/FHlqDRERMFradyGAwJjAWLAjMv?= =?Windows-1252?Q?pM8Pj193pXNOncsTLkrNBqWfPN8xTg1zi42xAD8OTEzU+yQnkpfze/gn?= =?Windows-1252?Q?D7v2uUHgqfXuAl5TqIBj9ZLHyjjfKvzgEQUxd+yYCzKP9vwwQstcvK0G?= =?Windows-1252?Q?5IldZj9SXo6dVsWipu7FbMGh3za3+uDuFFoF6kJRQVqt7iv539qmHZt5?= =?Windows-1252?Q?KALC7Ejib3qG6D09i7/1zB+7yuLnS8NQ?= 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: 0899a35a-9c13-48fa-13c4-08dc0e4dc54d X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2024 00:23:56.4782 (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: /Fc+c4xQLmy0Hj0y6rKvbNcpWwAGpea+ATxtKvbjY/Ob6LuSd20hUDUSMt82Kzkrn/FYumOy+HRuxmJfx6WHng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8142 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: vs5o2JvXJ6n9yT3XbS42rjxux7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BY5PR12MB55440B1EA1B2CCFDBFFF7EE1BA652BY5PR12MB5544namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=k+ShugzH; 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 --_000_BY5PR12MB55440B1EA1B2CCFDBFFF7EE1BA652BY5PR12MB5544namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable 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 (#113322): https://edk2.groups.io/g/devel/message/113322 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_BY5PR12MB55440B1EA1B2CCFDBFFF7EE1BA652BY5PR12MB5544namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Thanks Saloni. PR for getting this merged is available at htt= ps://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.group= s.io <devel@edk2.groups.io>; Clark-williams, Zachary <zachary.clar= k-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>
Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default
 
External e= mail: Use caution opening links 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.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 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 <ashishsingha@nvidia.com>; devel@edk2.groups.io <devel@edk2.groups.io>; Clark-williams, Zachary <<= a href=3D"mailto:zachary.clark-williams@intel.com" id=3D"OWA3f10d77d-0b09-1= 36d-a81d-8c4002d57ff7" class=3D"OWAAutoLink" data-loopstyle=3D"linkonly">za= chary.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

 

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>
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 <ashishsingha@nvidia.com>; devel@edk2.groups.io <devel@edk2.groups.io>; Clark-williams, Zachary <<= a href=3D"mailto:zachary.clark-williams@intel.com" id=3D"OWAca9d4399-d7cd-b= 240-5850-ff8b0c446471" class=3D"OWAAutoLink" data-loopstyle=3D"linkonly">za= chary.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 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>; C= lark-williams, Zachary <zachary.clark-williams@intel.com>; Jeff Brasen <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>
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 (#113322) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_BY5PR12MB55440B1EA1B2CCFDBFFF7EE1BA652BY5PR12MB5544namp_--