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 D66A0AC17B2 for ; Mon, 1 Jan 2024 16:47:44 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=/zXhM5j+XqhTZYbT4skw5fLrq3LB9LDeUxVEjpkoDMk=; 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=1704127663; v=1; b=wuBwL/sSB7FFz6K8cy0pOLAdz7eb9ZHfxz0vT2arDLCn88PB+ADZ5fXpL91H3EXhON3lMMiM LnsQwuBGdDpQAdfPC7d2T9IKooTwxAACKSbIjRlNIr9m+tSlNtH5DGbV/5E/tznb0XheUD3hu2B Eo+fEv+U36BHM4RFrwEQKkP4= X-Received: by 127.0.0.2 with SMTP id gnQzYY7687511xUYcJOY2dMR; Mon, 01 Jan 2024 08:47:43 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.76]) by mx.groups.io with SMTP id smtpd.web10.9111.1704127662869002563 for ; Mon, 01 Jan 2024 08:47:43 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QtSzxy4+mtzUlNZfqDVeGfHmBtxne2Pcu1X8OxMW6ne7bonKl2rvGFpR0pFWP0FfTXHPx1b0tAlKMNzKovz+fF9nFRzUsD29YIJuvHqQNXW7TB9HuX0CEnTYofr5p1TxTSLzVhAsAqgSup3RuNHnlxjisUE6seTuf8i0wtdjwzmKYXPVEZd8KZRzWhjN4lol6e2rtA0BjOq+Ja2XCMmaAfXxpBMLgYFcDmrE2trhVtHmwVCimK0amEMX75Yh8t/hxxZpe6OEGxgbmFmGkezQJPMnIDbd6TgYJQahprbztQ9cx8S3ZkBInm06poagpln8sbSwzW0Y1tSHyVCu5w7GbQ== 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=na8smx1sfLJOgnbEpgiI91L/byhSNzacUcAxRqF/xxQ=; b=lO7b6dWvLtHYkD6nFBSeNqCIgnbmzlDvuoB7JIsgaLtF47by8MPds+afM0pNdv+EPcIhfrKJK6vjDCABdAKgEEZM62SBbdM/yC9UvbAez3HRPsRZvf7lKOviJLeChmOIbA3jTRs8KfWMIrZXZEwcfZ1/ARxDYlz5jCNj2WhqWH2ziqNe02ohAqhZkhMWffFKk4dt5Y7lwqoGHdvlLS/VI3Tg3fc0/2foF1LWFHHDDhlNrl45pUna4M/tlUTu4EBBACqi+1y8LJgJkGSOeQvtRbryXBa2mPz+oFZ+Yaqf8aWK8uDBUo+PNWkS0Rvf7nt3v3BofVOrJfWy/exWTTYJag== 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 SA1PR12MB8888.namprd12.prod.outlook.com (2603:10b6:806:38a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.24; Mon, 1 Jan 2024 16:47:40 +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.7135.023; Mon, 1 Jan 2024 16:47:40 +0000 From: "Ashish Singhal via groups.io" To: "devel@edk2.groups.io" , "saloni.kasbekar@intel.com" , "zachary.clark-williams@intel.com" , Jeff Brasen Subject: Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thread-Topic: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thread-Index: AQHaLuc9P9mSwxDcuUyB3JunDYT5ybDFRozE Date: Mon, 1 Jan 2024 16:47:40 +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_|SA1PR12MB8888:EE_ x-ms-office365-filtering-correlation-id: 82f2cfc8-15f1-4d6f-8359-08dc0ae95e39 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: ABVQHgrYUbVyvsSpBeCoPzMHrLo91WJRXA7OYaCeS6jQGbVNHDgH0D4m+tqsCbgm6x4TQmbV17IUTPmVxYeotgzWcWJ10zkn/LeVJYlyg1x86hcj/RoMQziCBD8IrU2Cqu3bUg4dyf5DejalkobqYjeSAoT2RK36UeyomQwZTq01l4Lp7hsbo2ywY6Hp0Y5f7iHjYv7QNEeXAqbyCvAxJIdpSq8BXySdTDRD5MiKGGoAsvZ54rdB7uY/iIQtDAYj4D9mrClauM5dDpENa001g8kLqLf3FEDglP7IVhINkgnRPsGxiJ69SJFlaAY7aRS0iGaI/ME8a8xsdj/koCRrnMsaYpJLJxFGVZ8JFOMUVj1lkTaiqyAFGBtmK9sJ77Cl+G/wUnmRZtJ05yWYJ2DYkpoF24pQc2t5QNtTFrb17QchjQlYVlLDwSysD9D9MfxGh5H7MGuY4y176KKOFmLtQN6q/ZQ6726px1Ql9R1PEl8TA/cRFRIDniHie2+P449PGLZh1nYG1qQGo6jzpcODX9ve379m7YyFvqLqj6bhWTdMkUds7lD1y0Jolx9ZdIJQfXcvuNXJuIq0dVOCykf6vk7/1PcGCSpxg6zYK2nudhx8Ppb9n72MJ4UVDhDg5W7r x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?zEGZ39W2Ivnv8SV+FrrvXMBI3a2TCvF3AoUzkCm9qwugvukxS7h3Wd/OZb?= =?iso-8859-1?Q?UIulsZQVLs4ll6KpXENO5PUJ1H5dSVc8JXlLOQ+2048aZmrOT5oc89LyS0?= =?iso-8859-1?Q?Nw6o5bbVfb2oXAWxy8rXOnGtgMfoxYitMDWg7rXS+m9xbGA7MUT89dFzpi?= =?iso-8859-1?Q?hIe30ael5b3FhCSsCO59GlOdZr97ZKQzkDTOvuKu7Pg4XLZ+oQBqdvRlC+?= =?iso-8859-1?Q?eVmOCLr25vtLKsDkEHjBytjzgzajtrikS48/tElI5Z+oJy4ezwntoqFSN0?= =?iso-8859-1?Q?XBlo6MxXBjF1vJU5krQfC+10dW9if9xAa1W0ZoYIjBp27NwUUtrjiPXtbn?= =?iso-8859-1?Q?fkecfuyQJpeFETc9NY+DxLyd5u1DYVvFHdPoKaPfdJFNqL+gBZC7pSPQGw?= =?iso-8859-1?Q?el5B4ho9h59h4Xt3h7ck18W3TimA/l1tqdF7qsQoKfZjNV5zDlx0qBmPNk?= =?iso-8859-1?Q?J4kN54ckN6Fh9eAkC+UWYoHKAMe55hhoqQXvG0jLDwO/huqa24sHcsXG85?= =?iso-8859-1?Q?XUpgCg5OsTL5zkKb4ianJRBBOievKRGbPPc6u1F9BArYZI4bFd+748sShF?= =?iso-8859-1?Q?m0S0W9KlRfYTDDTKLJu1ssUdNLYz328+g5D1UK+RZvxXZH4jZjH2tX9l5a?= =?iso-8859-1?Q?vKqRIvKo5d+FmVAjWhI9Q5UQdiaWJ7dZYSbVatdUj/b+co8IsB0p+ATBkc?= =?iso-8859-1?Q?WXdzLxQTPo25eUmEmHqMCv5H3bDHurz7oLzy+Rm9F1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EEHprPaomy0M2cqPfKMT9sUgKeFQipBM?= 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: 82f2cfc8-15f1-4d6f-8359-08dc0ae95e39 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jan 2024 16:47:40.3720 (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: A+p0/T6mdOx2QbE72NMsf4/kg2LdGdayw+9Y1pVCTOOIhbzz0qsd/iSGwaKe+sSw5zmXbUQTmA7Lvy3EptGhrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8888 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: 5REvwyxH7iTEoEqhvvPcJJDXx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BY5PR12MB554486CA83CC10DA0FFFAF65BA62ABY5PR12MB5544namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="wuBwL/sS"; 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_BY5PR12MB554486CA83CC10DA0FFFAF65BA62ABY5PR12MB5544namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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, -=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 (#113013): https://edk2.groups.io/g/devel/message/113013 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_BY5PR12MB554486CA83CC10DA0FFFAF65BA62ABY5PR12MB5544namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,

Checking again for some feedback on this.

Thanks
Ashish


From: Ashish Singhal &= lt;ashishsingha@nvidia.com>
Sent: Thursday, December 14, 2023 4:42 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>; saloni.kasbek= ar@intel.com <saloni.kasbekar@intel.com>; zachary.clark-williams@inte= l.com <zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvi= dia.com>
Cc: Ashish Singhal <ashishsingha@nvidia.com>
Subject: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default
 
Exercising reset to default does not reset the set= tings.
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,
_._,_._,_

Groups.io Links:

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

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

_._,_._,_
--_000_BY5PR12MB554486CA83CC10DA0FFFAF65BA62ABY5PR12MB5544namp_--