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 A08237803CE for ; Wed, 3 Jan 2024 16:51:41 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=BXoWVowkzwzLk3qnO2AqoBb/9+MZSYYP+3a8Xtw0F2U=; 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=1704300700; v=1; b=CjtYT4seiKRlio6mFOavcLCd+J6DTBdQ2cY2McZkwcIc0zhdsUeWczY5K0494fUjscVM4zxc V4EEubpxIaY0i/YBJHnvzT/fpP9aLZ7mxRz0H8x7Sm+HMvcGXvV0UOtz+otGiEY2QD9zhmI5J5x hJCq31LnBSuoJ0SKWC8ELTMA= X-Received: by 127.0.0.2 with SMTP id w63LYY7687511xc0aFpoTWxq; Wed, 03 Jan 2024 08:51:40 -0800 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.57]) by mx.groups.io with SMTP id smtpd.web11.22188.1704300699489996947 for ; Wed, 03 Jan 2024 08:51:39 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z+PxjrTF7ckWOlBdRywGvzjNpKoWeG9qr6OYLziIdY9PJjh6+2v8MX/9XBcKPv06lQnGAunhRa6tKh+HBty22uCusvLfmyPZdFXYQBI3mRyNPyHVLQfwkQ6xlOucokKpWL4qV8xEu4HbL5CEsCsW9UuzzLLwLWiHS9FgCkbwHionj54KGrzdXiVXq/MaD7u+rtSI21JcbM61tig4+3tR22LKaq8lyQZ5pxqHqeisjTCpe6u9RLLH1Jsuf0TReFvQITDHGQGByCU1/Nm3QLsX2W2lATW2WpThchUj/fR1doe6tGwIG/9XXit6W0N/zRZhGPcelEJG7TmaJLEymcUBzA== 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=0t9TbNPwN1CoJk9owjGjHXMuKpqXnV10BeC/VRFXgo0=; b=E1yi1fyuPN7k1gWUay5yeOIzPdlHF4cg54NdykPE4zE7+rBzGnmN+6KOWKCHpmpnPEPP5cevfBngoR3RAXbKquHVyZP2blItgpbelShQfPRXLFjsgCgMyMrA6y8OIukoiK199igp9PXvSf/ww7MUD9Kv1JsVh8NCKm8ZYtKNs1xFi3G7oR/GbfTUGjc6NP5Mep1GAwiq6/HsDUO1rJRoQdQOsoiIQzQOPQKRVDiKgLM3yHQESNZwO3b3I5wEXN1qWfWC4Sth890VfiUORfM3cuj7Uw593EBQEGBE0+9V51xIs2JgrV8H7ILN9s9bNlOYi+kFpgmfjCmwDJU52GoYlg== 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 BL1PR12MB5778.namprd12.prod.outlook.com (2603:10b6:208:391::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25; Wed, 3 Jan 2024 16:51:35 +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.013; Wed, 3 Jan 2024 16:51:35 +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: AQHaLuc9P9mSwxDcuUyB3JunDYT5ybDFRozEgAHVYACAATCxsg== Date: Wed, 3 Jan 2024 16:51:35 +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_|BL1PR12MB5778:EE_ x-ms-office365-filtering-correlation-id: d9a09fb3-637d-4e40-7f84-08dc0c7c3efd x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: Un5WtoHT3RYhGYGEJewTRZ+jW2n2euGQLNlt77YMZm0FFJ2cW63G5AxTZLf/PEb1cQENEfdvlBjl5jUOQmEgbkkECXrxxowGrDDSQ03deA6m9zn0VLz7sc8nXvYhHJgtp6c8ldOAB2BxjIxCW9deyn89GQuNkAbXIqTk4Jf4NEDcxmSOGVQSHCg0N7WYCgahHS11DPvMS36ccc72d3JuLe8KgwJbH432iIePDi8jyKY2fe00BZtHPtD4UjP76Ibzr+MXxXmvXQYD4pOGxCwOcPdVvEM9EvaNttTSepsM5T7Zr72RLnlKpgNZOHbwL+g+bEZdsvubtTndzRwvssJy3Z8wA5AFoGdbGBEieNns3Yfvr1mESa3StDLo5svyGRTn5C1OLYF+jUHg4fp4srgwR0RQYDFbLb0qiZaP2LTwVNQDX76Jt4HOeuYFWq/kM5TfGU++dZ+tzhEJRAR8bl+JR8tnpnGTgl1ekXniyNGVPACjbdx7HxX0gGgTnBM9Bk06saqvXapbhJoRAAqBUfSJW/IloSibu1FX3uom0dnpcJ9D7z4YH6RyB6E+G9LCUn2Ocg+U20tfyqgqfuG6yHzj5fL0+40QfaNCEPpn3lFcGRIvo1qXOlJSLVkRt4GzROizspuILTWRzUipaWAqcdJAlDLG/xJBsaz1Xz6Sd/jymck= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?z1UDpTCKhcOBXYgFYCiyEcjHdHphBUeq2jN4R6TSaSz5Au+rlPsR/7aM?= =?Windows-1252?Q?hY/BTxLSddTvxmtpUVr0QcTB7FP9s0Hb30wTEzY7KQCqf2CutUry96Eu?= =?Windows-1252?Q?x0sith8vIViRBdQwmHF2uW5/udckOVdZgNVEK5YWsV58MKejqQHuYtYv?= =?Windows-1252?Q?bvIQrtuSvg2vybfjfxZBFnPFdly+QIBLyWqMLPP5KPkbpXn2bbBOVaQq?= =?Windows-1252?Q?1K/6EoTa7qZW7U3XF+3lwgAZ4cnbJaRMy4hPX5KxGx+YfLBeea1Z5+LC?= =?Windows-1252?Q?vVuQYUtObWXHR9aazHWUF3yKMxP9ArGTiEY5Lvx/SD39fn2g21dwUmi4?= =?Windows-1252?Q?5zKTg3Z+652Cfnnw3qdCZLCGTDXcxr4Kx6IRqgvYbd74kUbKT9pABj+F?= =?Windows-1252?Q?oV5U0ZK0KUEfuxsG49Cyh4cVGvTn1/PFGMhWyzsjPEErpm/rnTNbCgF2?= =?Windows-1252?Q?HYl8zYydzoQOcCvdLaQKfZLwyn3yuulHnzsrb02Onhusll7VbunFta+D?= =?Windows-1252?Q?mkHOKR8FvC2Z8UkDUGL0VqHsBXYgDfAEHasvEG9hzBaRrDFl6+U13NPl?= =?Windows-1252?Q?B5pmjXxTFgP0gkhYvBKXTH/BluBEKze2khSUUNYoaE2YLKQHOtVIT9od?= =?Windows-1252?Q?ocuV+JhA5wxq+fb8UeI0rks84oHnKkzL/vEWreAXe7VUe8DG/BXlrp6b?= =?Windows-1252?Q?e9Ga/hPLAac4dxaXULPU2BQ2mhFTpvV/Yp5ulQeEv7HouiSnumo63ShX?= =?Windows-1252?Q?8G7+uyGDYURK3nOsxkxnRCHVPPhaSpRm4SzEmgtbZztKSn5XrlAZY28u?= =?Windows-1252?Q?q3DGB9WltGTYi4TCUyWm+1J51SRQ3uRBaLde83rq5kWbP/WBgG+ItfAQ?= =?Windows-1252?Q?+t0qc0HrQiI0wZMH0mvPPCvpXyQFM0q0T7NmZbhFI62SAf9xqnwzyxFT?= =?Windows-1252?Q?x112ZD8k9dmlna1Jdh1LJM7HfJY1fx4tFkMFxgK2ksZ5riXqGBCMflAU?= =?Windows-1252?Q?C8aKCDAl1Fl95gCnx2HvEI/xoXGeb0JZ9Ih5uCDD+JIpEwFNCrYBHnZt?= =?Windows-1252?Q?iQTnIaJH0lrpNPTMIjer14UA+Ph6AuHASCQTGJ4+s9DhTK/pQFrX/rr9?= =?Windows-1252?Q?7dT26+co33cNSIEOEDWWV4fTlP6HGGN7RKDP15YNvPzuXYjVlzxnBQFX?= =?Windows-1252?Q?kfeNhcpneEjVMRpzOlw6Kelr7Aj+ZLbR14RAk6hPph2Ad+7sQE1dRXzX?= =?Windows-1252?Q?0MPrUkUB7iw+xlBSEPGTzlLJ6HXhKWwzVLWsUxF+znJWqXURPelR8/Ko?= =?Windows-1252?Q?veDBAboW/3xisPFz52URgOOOak9Nhq0E7m2b5MCH9xxJbeoFdOkVmuhs?= =?Windows-1252?Q?DiGf6VJGrtl1AsbTtLtgHuBoHWin+rB/0Jz/3lffaXOzhaDGM0nzVlPt?= =?Windows-1252?Q?SAiDcgno6efGqOJZT93JAof1zG/yNLsCwiMMmQH+HDS4WPKlMycuXftm?= =?Windows-1252?Q?ld6v1TvwiN0wbiIshwz7QFZ0FPYgBGsHth3a4eqyMiJIsuj96Yi/pKj6?= =?Windows-1252?Q?d0nM8W103XKKaK+MfLxpPrRRIODnCnhJO604f1GS7yDJTLOhjHZkr0UA?= =?Windows-1252?Q?4uFOyC+FepARkAdLCtPmLv310oiVR22vtt2QT8YjqzU0yEKxhTIwLlz0?= =?Windows-1252?Q?KBy9xTX1/NAW+eJsPtMVuDFask3ABUTb?= 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: d9a09fb3-637d-4e40-7f84-08dc0c7c3efd X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2024 16:51:35.1712 (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: K8jUXtkg9+9BlO9XwgQVevHwZH1kudCQmbiyF8sQTEdFnLSkt52oFNYe9gKIpREtGaMLritkAUxEmqZ4/+KgpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5778 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: 8k3eNMTe2JJM8I5xYN9WjE5Hx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BY5PR12MB5544439913AE9C8112DDAB84BA60ABY5PR12MB5544namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=CjtYT4se; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); 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_BY5PR12MB5544439913AE9C8112DDAB84BA60ABY5PR12MB5544namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable 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 ; Cla= rk-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 (#113102): https://edk2.groups.io/g/devel/message/113102 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_BY5PR12MB5544439913AE9C8112DDAB84BA60ABY5PR12MB5544namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
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 see without any configuration don= e 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.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

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 <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,
_._,_._,_

Groups.io Links:

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

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

_._,_._,_
--_000_BY5PR12MB5544439913AE9C8112DDAB84BA60ABY5PR12MB5544namp_--