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 3327574003B for ; Fri, 5 Jan 2024 10:34:05 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=dkS7auWP9E291CBoaS40POMha1iZUv41epjvu/zhPUk=; 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=1704450844; v=1; b=gLChGDTT26uqw/QgQ7jDXFq0pu5tRTROMFLhGTtgMQ+VbedcEfD7C8dSy9vVJIL/yoEr9U/N 7tO/LUiMVC1yNKzAxgRW4KnPnnjuJoAP12ZseTKMPPqDREmSeTMSZHbg8on25/7Gkf0kXenSifr gRpVNhCJTtkN7QmsWuV/g74w= X-Received: by 127.0.0.2 with SMTP id oRUvYY7687511xtMDiTjpJ1I; Fri, 05 Jan 2024 02:34:04 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.81]) by mx.groups.io with SMTP id smtpd.web11.20858.1704450843905496007 for ; Fri, 05 Jan 2024 02:34:04 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h8n5kFUAJYFytZIPxUF4s8zk7rWwAHTLE271zZlYpVYXAvXzUXyxAK3tG4vspQvWf7K4Zhk5yORmVpmIoGJPZtLEvGazGIhr033hbVinks3YXddF2VyM11sbsEMhcMgkMg0t0IUkLsQLbAFtH/1mVB8/bZK/Z8X+4nRokmP+3by7MwNWDq9QmLH+b44I5V8VYnvIsi7Q9Rtkc96ycjcU2BoTz/BxCQDA35xvg/Vv9Y8H4Z5xCTqd86eqEVYXKKwihofAkHFsszNeDXZpK0NXo+uOc0v/lviCfbTzuVkG3S3RAuoCPqYfk4nbxml2Xaj1mCY38Mg1HCYLG/65nACDQQ== 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=gbFSU36yNi0q1eRccb6bJf+NrDYw6pm7dQ/4uD8rF6M=; b=HkRZgi8fsT8imgSO/uNrtH39nx1DHsdnKgtASTMUy4VrEFI3/C+INC7KNEwlwWjqzYH6PA2jWXcLvyzpFKmxNeOthXuX+v+GUOaBuquOyFBwMbaTByE0h606vOVqFiGGYd9XQ1+LpGIk7MpkQ20yVTjURJBP+JpUxxR6jry+IM8dOEX7FzK58IbexY1cPxYD1pOUjEKukvF3TvVVwg67MU5jv2PVuhYe8EGk41IHqHSnEBixst0mNamWTf4F6+ZgEbmmpiU3SVueg3r7PBSEtiUppFrqt/MbUqCLMCeot+ACbBaLR+I0Y9pZcwDVZvIaRNaArU4GLLm0Gd4spd/eyw== 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 CH2PR12MB5546.namprd12.prod.outlook.com (2603:10b6:610:63::14) by DM4PR12MB5264.namprd12.prod.outlook.com (2603:10b6:5:39c::17) 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 10:34:01 +0000 X-Received: from CH2PR12MB5546.namprd12.prod.outlook.com ([fe80::3bc6:9fce:87f5:b74]) by CH2PR12MB5546.namprd12.prod.outlook.com ([fe80::3bc6:9fce:87f5:b74%4]) with mapi id 15.20.7159.015; Fri, 5 Jan 2024 10:34:00 +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: AQHaLuc9P9mSwxDcuUyB3JunDYT5ybDFRozEgAHVYACAATCxsoAB974AgADi4Gw= Date: Fri, 5 Jan 2024 10:34:00 +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: CH2PR12MB5546:EE_|DM4PR12MB5264:EE_ x-ms-office365-filtering-correlation-id: e36a09bb-3080-4d6c-994a-08dc0dd9d4bc x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 2YcF9soSLDoJ26DoavXqDWmBwxY/+QcAesPuhKQTS+0D9aIT2oJUAL0wi7GsZ/F/5cAxwFVCjAKer0Q044Rj9S5FZ8njAuprEyNHWxDDTCELzpyub05AvRemippzCCQ3SBTIswScfnaMuYjjTVZDnHto3iQQPVWpTqoYhtbIhbJtDDoPbWHj55VArxt86Fgwa8lLWzjMxV/Zm/obM8N0nQBz1J7EKxMb6JF13O/zNBTEvS+YjlfOmK46zJwozTy1hjIm2nJ9UIOflh34BJs7M1pwetQIIcy3DAIKPjtEX8idmbbYIibWA7f+SVqJTtucqJygET8pmUeiXCzdMFgrTDgfiTMEP7w67h5Hg4nfmsWUWqn1DYiYlvxTfdGCHVUFJZWsfvqbq/9lk+hRuv2HBBi9BiZByVehlao4mFKe/Pp6EK/DNOOlXgMKXRy1CbvzrBQrCxmwmLrH2SDo/N6Eb972T/x8k6vOCJAC3I6R9dKWmdGpVQmO1infIfQiGWjNVMVSn4DB938nwecAVnvSM60fnzcEnsfSUUjJftrK1lpdZfpY+FhXI5sGpGBzG4SgMYsXRkQbvkEzdvPPINRXoFaH4DJ9LHOti69LN1KyOCjOEFgKItE7M2jYUw/Jm/fkDFZuCyVQ+Jh1i5dLpC8/RbyBevQQJyYzi295T9iaIQk= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?V4Jz4unTImu6r3ajBf+PVJtk7yBMPvQgAYJPB8ctn5ed8mbtxI794mrQ?= =?Windows-1252?Q?9m4nUmZFS+nNU4Gnv2bkmaZafUZDqwKdBbbQqFlXXtxPCuPsc9J1QaSf?= =?Windows-1252?Q?CkDKALmytku+oXEJP6Gl7BlWceHjNOGK0UyKceUaov3YFYp8xNCqSb5l?= =?Windows-1252?Q?M8U53j2TWhdJzXA6WMA/a3t2Uoxdwj/FrOS1515beRl2q815r1X90AN/?= =?Windows-1252?Q?Yyursu2CYhn8NtzcBKAN21fOprHR3mIOFAJHH44Y87em0Pb0OedgnU3s?= =?Windows-1252?Q?iZjqG0MieIL/VYh+05tpteWQgnylOllNcvGrDqnxt0riM++RmsrtLWw3?= =?Windows-1252?Q?IPa9fL4sQ/WG9K0mmBpvy6u2TZ2ztNjkSZSgAgpvYKN02OURFDcGOZ1t?= =?Windows-1252?Q?xGAwdhb+RRtjQgxQDSXFeYS2s1Y20puPxIpdTRAT0ZSdJvUmgd7sPdjy?= =?Windows-1252?Q?PYo6r0SW7hms2gVQ+fTQoGH8OHyBwmZ6yAl89AWVddq9WwDVVbI93fM4?= =?Windows-1252?Q?4m9xCH3GYstwNnocTbOJxMlO5n1SGSbSlgd06ANPvi/5aPdqB7qwjiNI?= =?Windows-1252?Q?Bvi0zck16mIgu+llVOqQ7ltE1R8jlOBT0jBGCeh+gz6y1ODwXc6npShF?= =?Windows-1252?Q?rvVrae9BbD+y3VuysjRTB8h+OeAiedZU7V6RGJ9dDowOhoZa6xZ34f+2?= =?Windows-1252?Q?sQX14hvmdEc1RKWLNufTtaGC9/0eXXf6x+2CYmcLE7PeFF1KOsPrA0Zt?= =?Windows-1252?Q?My3JHVZun+nRqBGodA7uddxIiTDKnwAUV6bNqs6ZKvYbMCNKqK9pw8l7?= =?Windows-1252?Q?P1UCCjPYM5K6L5Ar4h4OsZ4HidC69FUoG/l3zdT3ptSoMM6kzbNeZh4G?= =?Windows-1252?Q?6jbLcfjPT7LJjdtspiyOcSkxscHxXPrBauRvkS+mXJzIB3+pOmH/OkNT?= =?Windows-1252?Q?tF/KjW97QfNti4VA7R+GGtlnStGYYFav+7lGaR8s31tNI4H7cP1phb+f?= =?Windows-1252?Q?ZKCAS/lTrwnaFMzoUGC2gPVWqcwDF7DwQMuEE/zdLaF8MS+jqKHa4sm5?= =?Windows-1252?Q?1R9OhPCdBv9HvIUmz3/jLorRfUtfi6+2+XmLT5wBfVRTVyurgPchmHmh?= =?Windows-1252?Q?D54LQTmqOOWDH05qSJjRVpeHRxE3MX48asmHoXNddoL0er1z0lRjpBju?= =?Windows-1252?Q?UgkILkszXPgOx2Yrur3NAnSyufo53DdUtfrE+1MBWajrdfUWR6/91cgJ?= =?Windows-1252?Q?7tjf87RWwhwTZoWaHkp50O0cpM14hsoRArwUsqUlle/MUw6OoHXu4V5O?= =?Windows-1252?Q?a2GFyOd1gYeMP+lmgH3zt4o3yZoV8HAlpJhTiVAzAM7JRPGTUYkIyxeA?= =?Windows-1252?Q?xHmFqgJRxKHaOhwqHARqx8oCXfc6cbgQww3tBfLqKW9us1J6OaojSOI3?= =?Windows-1252?Q?ArStvthQlTg0QkjCQONArEfpVvzraZBe7plKRLVFurh1dKjh6GLn5StW?= =?Windows-1252?Q?8fU5RCndMDtLm5FamLfSbTvMxYQDRX0o5b8Cd29ppITT6qQ2aVbsxB8Y?= =?Windows-1252?Q?d3FimzCs+7vJvbbVEF9yrTXA7clGh7yts9GQTuOOND/85EIxKDRDcEKQ?= =?Windows-1252?Q?4iVzZiQvsku9WUu3kyCMY//B+upNXRi26iqB36izVJVR76tqhJmMlbL9?= =?Windows-1252?Q?ckPjQksbKZP453dln6buuzbwIB4My7oz?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB5546.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e36a09bb-3080-4d6c-994a-08dc0dd9d4bc X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2024 10:34:00.7504 (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: wrQyNPbt9/OJ1d7h4wkWH/UPpbYB9bEjotLIH6Pv2s6Xc8zSZOFNpYnOxdLZd/XslTbrBFT2RUJzejMcJ+g37Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5264 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: mYgE4GBoHR7APegfE1G2ALr2x7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CH2PR12MB554632BBE13F5575D0BF3BEFBA662CH2PR12MB5546namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=gLChGDTT; 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; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") --_000_CH2PR12MB554632BBE13F5575D0BF3BEFBA662CH2PR12MB5546namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable 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; Cla= rk-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, -=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 (#113271): https://edk2.groups.io/g/devel/message/113271 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_CH2PR12MB554632BBE13F5575D0BF3BEFBA662CH2PR12MB5546namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
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= <saloni.kasbekar@intel.com>
Sent: Friday, January 5, 2024 2:30 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

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.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 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"OWA9b67f1da-fc17-e= 565-1cb8-812ea31180b2" 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,

_._,_._,_

Groups.io Links:

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

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

_._,_._,_
--_000_CH2PR12MB554632BBE13F5575D0BF3BEFBA662CH2PR12MB5546namp_--