* [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default @ 2023-12-14 23:42 Ashish Singhal via groups.io 2024-01-01 16:47 ` Ashish Singhal via groups.io 0 siblings, 1 reply; 14+ messages in thread From: Ashish Singhal via groups.io @ 2023-12-14 23:42 UTC (permalink / raw) To: devel, saloni.kasbekar, zachary.clark-williams, jbrasen; +Cc: Ashish Singhal 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/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112572): https://edk2.groups.io/g/devel/message/112572 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] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 2023-12-14 23:42 [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Ashish Singhal via groups.io @ 2024-01-01 16:47 ` Ashish Singhal via groups.io 2024-01-02 20:47 ` Saloni Kasbekar 0 siblings, 1 reply; 14+ messages in thread From: Ashish Singhal via groups.io @ 2024-01-01 16:47 UTC (permalink / raw) To: devel@edk2.groups.io, saloni.kasbekar@intel.com, zachary.clark-williams@intel.com, Jeff Brasen [-- Attachment #1: Type: text/plain, Size: 2472 bytes --] Hello, Checking again 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/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, -=-=-=-=-=-=-=-=-=-=-=- 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 6568 bytes --] ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 2024-01-01 16:47 ` Ashish Singhal via groups.io @ 2024-01-02 20:47 ` Saloni Kasbekar 2024-01-03 16:51 ` Ashish Singhal via groups.io 0 siblings, 1 reply; 14+ messages in thread From: Saloni Kasbekar @ 2024-01-02 20:47 UTC (permalink / raw) To: Ashish Singhal, devel@edk2.groups.io, Clark-williams, Zachary, Jeff Brasen [-- Attachment #1: Type: text/plain, Size: 3649 bytes --] Hi Ashish, + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we're 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 again for some feedback on this. Thanks Ashish ________________________________ From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Thursday, December 14, 2023 4:42 PM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com> <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com> <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Cc: Ashish Singhal <ashishsingha@nvidia.com<mailto: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<mailto:ashishsingha@nvidia.com>> --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113041): https://edk2.groups.io/g/devel/message/113041 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 10769 bytes --] ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 2024-01-02 20:47 ` Saloni Kasbekar @ 2024-01-03 16:51 ` Ashish Singhal via groups.io 2024-01-04 21:00 ` Saloni Kasbekar 0 siblings, 1 reply; 14+ messages in thread From: Ashish Singhal via groups.io @ 2024-01-03 16:51 UTC (permalink / raw) To: Kasbekar, Saloni, devel@edk2.groups.io, Clark-williams, Zachary, Jeff Brasen [-- Attachment #1: Type: text/plain, Size: 4542 bytes --] 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, setting value as static does not have any benefit as it forces to reuse the old network settings. Using DHCP really mimics the 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 <zachary.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 = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we’re 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 again for some feedback on this. Thanks Ashish ________________________________ From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Thursday, December 14, 2023 4:42 PM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com> <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com> <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Cc: Ashish Singhal <ashishsingha@nvidia.com<mailto: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<mailto:ashishsingha@nvidia.com>> --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, Hello Saloni, -=-=-=-=-=-=-=-=-=-=-=- 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 14697 bytes --] ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 2024-01-03 16:51 ` Ashish Singhal via groups.io @ 2024-01-04 21:00 ` Saloni Kasbekar 2024-01-05 10:34 ` Ashish Singhal via groups.io 0 siblings, 1 reply; 14+ messages in thread From: Saloni Kasbekar @ 2024-01-04 21:00 UTC (permalink / raw) To: Ashish Singhal, devel@edk2.groups.io, Clark-williams, Zachary, Jeff Brasen [-- Attachment #1: Type: text/plain, Size: 5310 bytes --] Makes sense. Should we also set IfrNvData->DhcpEnable = 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-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 the feedback. After the reset, or when we disable 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 DHCP really mimics the reset behavior that we see without any configuration done manually. Thanks Ashish ________________________________ From: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>> Sent: Tuesday, January 2, 2024 1:47 PM To: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Hi Ashish, + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we're assuming IfrFormNvData->DhcpEnable is TRUE. Should we check it before setting the policy and calling SetData()? Thanks, Saloni From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Monday, January 1, 2024 8:48 AM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking again for some feedback on this. Thanks Ashish ________________________________ From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Thursday, December 14, 2023 4:42 PM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com> <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com> <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Cc: Ashish Singhal <ashishsingha@nvidia.com<mailto: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<mailto:ashishsingha@nvidia.com>> --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, Hello Saloni, -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113200): https://edk2.groups.io/g/devel/message/113200 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 14933 bytes --] ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 2024-01-04 21:00 ` Saloni Kasbekar @ 2024-01-05 10:34 ` Ashish Singhal via groups.io 2024-01-05 20:01 ` Saloni Kasbekar 0 siblings, 1 reply; 14+ messages in thread From: Ashish Singhal via groups.io @ 2024-01-05 10:34 UTC (permalink / raw) To: Kasbekar, Saloni, devel@edk2.groups.io, Clark-williams, Zachary, Jeff Brasen [-- Attachment #1: Type: text/plain, Size: 5938 bytes --] I do not recommend doing that. Setting policy via SetData does enough to wipe 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.groups.io <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 External email: Use caution opening links or attachments Makes sense. Should we also set IfrNvData->DhcpEnable = 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-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 the feedback. After the reset, or when we disable 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 DHCP really mimics the reset behavior that we see without any configuration done manually. Thanks Ashish ________________________________ From: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>> Sent: Tuesday, January 2, 2024 1:47 PM To: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Hi Ashish, + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we’re assuming IfrFormNvData->DhcpEnable is TRUE. Should we check it before setting the policy and calling SetData()? Thanks, Saloni From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Monday, January 1, 2024 8:48 AM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking again for some feedback on this. Thanks Ashish ________________________________ From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Thursday, December 14, 2023 4:42 PM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com> <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com> <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Cc: Ashish Singhal <ashishsingha@nvidia.com<mailto: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<mailto:ashishsingha@nvidia.com>> --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, Hello Saloni, -=-=-=-=-=-=-=-=-=-=-=- 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 19390 bytes --] ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 2024-01-05 10:34 ` Ashish Singhal via groups.io @ 2024-01-05 20:01 ` Saloni Kasbekar 2024-01-06 0:23 ` Ashish Singhal via groups.io 0 siblings, 1 reply; 14+ messages in thread From: Saloni Kasbekar @ 2024-01-05 20:01 UTC (permalink / raw) To: Ashish Singhal, devel@edk2.groups.io, Clark-williams, Zachary, Jeff Brasen [-- Attachment #1: Type: text/plain, Size: 6744 bytes --] 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.groups.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 goal for reset to default. ________________________________ From: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>> Sent: Friday, January 5, 2024 2:30 AM To: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto: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 = TRUE when updating the Policy then? From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Wednesday, January 3, 2024 8:52 AM To: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> 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, setting value as static does not have any benefit as it forces to reuse the old network settings. Using DHCP really mimics the reset behavior that we see without any configuration done manually. Thanks Ashish ________________________________ From: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>> Sent: Tuesday, January 2, 2024 1:47 PM To: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Hi Ashish, + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we're assuming IfrFormNvData->DhcpEnable is TRUE. Should we check it before setting the policy and calling SetData()? Thanks, Saloni From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Monday, January 1, 2024 8:48 AM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking again for some feedback on this. Thanks Ashish ________________________________ From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Thursday, December 14, 2023 4:42 PM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com> <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com> <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Cc: Ashish Singhal <ashishsingha@nvidia.com<mailto: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<mailto:ashishsingha@nvidia.com>> --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, Hello Saloni, -=-=-=-=-=-=-=-=-=-=-=- 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 18138 bytes --] ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 2024-01-05 20:01 ` Saloni Kasbekar @ 2024-01-06 0:23 ` Ashish Singhal via groups.io 2024-01-17 14:07 ` Ashish Singhal via groups.io 0 siblings, 1 reply; 14+ messages in thread From: Ashish Singhal via groups.io @ 2024-01-06 0:23 UTC (permalink / raw) To: Kasbekar, Saloni, devel@edk2.groups.io, Clark-williams, Zachary, Jeff Brasen [-- Attachment #1: Type: text/plain, Size: 7343 bytes --] Thanks Saloni. PR for getting this merged is available at https://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.groups.io <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 External email: 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.groups.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 goal for reset to default. ________________________________ From: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>> Sent: Friday, January 5, 2024 2:30 AM To: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto: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 = TRUE when updating the Policy then? From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Wednesday, January 3, 2024 8:52 AM To: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> 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, setting value as static does not have any benefit as it forces to reuse the old network settings. Using DHCP really mimics the reset behavior that we see without any configuration done manually. Thanks Ashish ________________________________ From: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>> Sent: Tuesday, January 2, 2024 1:47 PM To: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Hi Ashish, + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we’re assuming IfrFormNvData->DhcpEnable is TRUE. Should we check it before setting the policy and calling SetData()? Thanks, Saloni From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Monday, January 1, 2024 8:48 AM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking again for some feedback on this. Thanks Ashish ________________________________ From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Thursday, December 14, 2023 4:42 PM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com> <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com> <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Cc: Ashish Singhal <ashishsingha@nvidia.com<mailto: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<mailto:ashishsingha@nvidia.com>> --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, Hello Saloni, Thanks -=-=-=-=-=-=-=-=-=-=-=- 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 25454 bytes --] ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 2024-01-06 0:23 ` Ashish Singhal via groups.io @ 2024-01-17 14:07 ` Ashish Singhal via groups.io 2024-01-17 17:27 ` Saloni Kasbekar 0 siblings, 1 reply; 14+ messages in thread From: Ashish Singhal via groups.io @ 2024-01-17 14:07 UTC (permalink / raw) To: Kasbekar, Saloni, devel@edk2.groups.io, Clark-williams, Zachary, Jeff Brasen [-- Attachment #1: Type: text/plain, Size: 7857 bytes --] Hello, Checking back for an update on when this PR can be merged or if there are any other changes you recommend. Thanks Ashish ________________________________ From: Ashish Singhal <ashishsingha@nvidia.com> Sent: Saturday, January 6, 2024 5:53 AM To: Kasbekar, Saloni <saloni.kasbekar@intel.com>; devel@edk2.groups.io <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 Thanks Saloni. PR for getting this merged is available at https://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.groups.io <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 External email: 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.groups.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 goal for reset to default. ________________________________ From: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>> Sent: Friday, January 5, 2024 2:30 AM To: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto: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 = TRUE when updating the Policy then? From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Wednesday, January 3, 2024 8:52 AM To: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> 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, setting value as static does not have any benefit as it forces to reuse the old network settings. Using DHCP really mimics the reset behavior that we see without any configuration done manually. Thanks Ashish ________________________________ From: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>> Sent: Tuesday, January 2, 2024 1:47 PM To: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Hi Ashish, + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we’re assuming IfrFormNvData->DhcpEnable is TRUE. Should we check it before setting the policy and calling SetData()? Thanks, Saloni From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Monday, January 1, 2024 8:48 AM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking again for some feedback on this. Thanks Ashish ________________________________ From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Thursday, December 14, 2023 4:42 PM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com> <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com> <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Cc: Ashish Singhal <ashishsingha@nvidia.com<mailto: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<mailto:ashishsingha@nvidia.com>> --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, Hello Saloni, Thanks -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113950): https://edk2.groups.io/g/devel/message/113950 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 27610 bytes --] ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 2024-01-17 14:07 ` Ashish Singhal via groups.io @ 2024-01-17 17:27 ` Saloni Kasbekar 2024-01-18 23:27 ` Michael D Kinney 0 siblings, 1 reply; 14+ messages in thread From: Saloni Kasbekar @ 2024-01-17 17:27 UTC (permalink / raw) To: Ashish Singhal, devel@edk2.groups.io, Clark-williams, Zachary, Jeff Brasen, Kinney, Michael D, Gao, Liming [-- Attachment #1: Type: text/plain, Size: 8833 bytes --] Liming, Mike, Could you please help merge this PR? Thanks, Saloni From: Ashish Singhal <ashishsingha@nvidia.com> Sent: Wednesday, January 17, 2024 6:08 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, Checking back for an update on when this PR can be merged or if there are any other changes you recommend. Thanks Ashish ________________________________ From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Saturday, January 6, 2024 5:53 AM To: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thanks Saloni. PR for getting this merged is available at https://github.com/tianocore/edk2/pull/5150 Thanks Ashish ________________________________ From: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>> Sent: Saturday, January 6, 2024 1:31 AM To: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> 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 <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>> Thanks, Saloni From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Friday, January 5, 2024 2:34 AM To: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto: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 goal for reset to default. ________________________________ From: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>> Sent: Friday, January 5, 2024 2:30 AM To: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto: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 = TRUE when updating the Policy then? From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Wednesday, January 3, 2024 8:52 AM To: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> 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, setting value as static does not have any benefit as it forces to reuse the old network settings. Using DHCP really mimics the reset behavior that we see without any configuration done manually. Thanks Ashish ________________________________ From: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>> Sent: Tuesday, January 2, 2024 1:47 PM To: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Hi Ashish, + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we're assuming IfrFormNvData->DhcpEnable is TRUE. Should we check it before setting the policy and calling SetData()? Thanks, Saloni From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Monday, January 1, 2024 8:48 AM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking again for some feedback on this. Thanks Ashish ________________________________ From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Thursday, December 14, 2023 4:42 PM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com> <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com> <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>> Cc: Ashish Singhal <ashishsingha@nvidia.com<mailto: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<mailto:ashishsingha@nvidia.com>> --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, Hello Saloni, Thanks -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113956): https://edk2.groups.io/g/devel/message/113956 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 21791 bytes --] ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 2024-01-17 17:27 ` Saloni Kasbekar @ 2024-01-18 23:27 ` Michael D Kinney 2024-01-19 1:53 ` Ashish Singhal via groups.io 0 siblings, 1 reply; 14+ messages in thread From: Michael D Kinney @ 2024-01-18 23:27 UTC (permalink / raw) To: Kasbekar, Saloni, Ashish Singhal, devel@edk2.groups.io, Clark-williams, Zachary, Jeff Brasen, Gao, Liming Cc: Kinney, Michael D Acked-by: Michael D Kinney <michael.d.kinney@intel.com> I will prepare PR for merge From: Kasbekar, Saloni <saloni.kasbekar@intel.com> Sent: Wednesday, January 17, 2024 9:27 AM To: Ashish Singhal <ashishsingha@nvidia.com>; devel@edk2.groups.io; Clark-williams, Zachary <zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Liming, Mike, Could you please help merge this PR? Thanks, Saloni From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Wednesday, January 17, 2024 6:08 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking back for an update on when this PR can be merged or if there are any other changes you recommend. Thanks Ashish ________________________________________ From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Saturday, January 6, 2024 5:53 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thanks Saloni. PR for getting this merged is available at https://github.com/tianocore/edk2/pull/5150 Thanks Ashish ________________________________________ From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com> Sent: Saturday, January 6, 2024 1:31 AM To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> 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 <mailto:saloni.kasbekar@intel.com> Thanks, Saloni From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Friday, January 5, 2024 2:34 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto: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 goal for reset to default. ________________________________________ From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com> Sent: Friday, January 5, 2024 2:30 AM To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto: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 = TRUE when updating the Policy then? From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Wednesday, January 3, 2024 8:52 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> 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, setting value as static does not have any benefit as it forces to reuse the old network settings. Using DHCP really mimics the reset behavior that we see without any configuration done manually. Thanks Ashish ________________________________________ From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com> Sent: Tuesday, January 2, 2024 1:47 PM To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Hi Ashish, + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we're assuming IfrFormNvData->DhcpEnable is TRUE. Should we check it before setting the policy and calling SetData()? Thanks, Saloni From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Monday, January 1, 2024 8:48 AM To: mailto:devel@edk2.groups.io; Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking again for some feedback on this. Thanks Ashish ________________________________________ From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Thursday, December 14, 2023 4:42 PM To: mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; mailto:saloni.kasbekar@intel.com <mailto:saloni.kasbekar@intel.com>; mailto:zachary.clark-williams@intel.com <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Cc: Ashish Singhal <mailto: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 <mailto:ashishsingha@nvidia.com> --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, Hello Saloni, Thanks -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114017): https://edk2.groups.io/g/devel/message/114017 Mute This Topic: https://groups.io/mt/103181314/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 2024-01-18 23:27 ` Michael D Kinney @ 2024-01-19 1:53 ` Ashish Singhal via groups.io 2024-01-19 1:54 ` Ashish Singhal via groups.io 0 siblings, 1 reply; 14+ messages in thread From: Ashish Singhal via groups.io @ 2024-01-19 1:53 UTC (permalink / raw) To: Kinney, Michael D, Kasbekar, Saloni, devel@edk2.groups.io, Clark-williams, Zachary, Jeff Brasen, Gao, Liming [-- Attachment #1: Type: text/plain, Size: 8788 bytes --] Hi Michael, If you are going to create a new PR yourself instead of using the one I already created (https://github.com/tianocore/edk2/pull/5150), should I close this one? Thanks Ashish ________________________________ From: Kinney, Michael D <michael.d.kinney@intel.com> Sent: Friday, January 19, 2024 4:57 AM To: Kasbekar, Saloni <saloni.kasbekar@intel.com>; Ashish Singhal <ashishsingha@nvidia.com>; devel@edk2.groups.io <devel@edk2.groups.io>; Clark-williams, Zachary <zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>; Gao, Liming <gaoliming@byosoft.com.cn> Cc: Kinney, Michael D <michael.d.kinney@intel.com> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Acked-by: Michael D Kinney <michael.d.kinney@intel.com> I will prepare PR for merge From: Kasbekar, Saloni <saloni.kasbekar@intel.com> Sent: Wednesday, January 17, 2024 9:27 AM To: Ashish Singhal <ashishsingha@nvidia.com>; devel@edk2.groups.io; Clark-williams, Zachary <zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Liming, Mike, Could you please help merge this PR? Thanks, Saloni From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Wednesday, January 17, 2024 6:08 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking back for an update on when this PR can be merged or if there are any other changes you recommend. Thanks Ashish ________________________________________ From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Saturday, January 6, 2024 5:53 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thanks Saloni. PR for getting this merged is available at https://github.com/tianocore/edk2/pull/5150 Thanks Ashish ________________________________________ From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com> Sent: Saturday, January 6, 2024 1:31 AM To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> 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 <mailto:saloni.kasbekar@intel.com> Thanks, Saloni From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Friday, January 5, 2024 2:34 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto: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 goal for reset to default. ________________________________________ From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com> Sent: Friday, January 5, 2024 2:30 AM To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto: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 = TRUE when updating the Policy then? From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Wednesday, January 3, 2024 8:52 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> 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, setting value as static does not have any benefit as it forces to reuse the old network settings. Using DHCP really mimics the reset behavior that we see without any configuration done manually. Thanks Ashish ________________________________________ From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com> Sent: Tuesday, January 2, 2024 1:47 PM To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Hi Ashish, + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we're assuming IfrFormNvData->DhcpEnable is TRUE. Should we check it before setting the policy and calling SetData()? Thanks, Saloni From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Monday, January 1, 2024 8:48 AM To: mailto:devel@edk2.groups.io; Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking again for some feedback on this. Thanks Ashish ________________________________________ From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Thursday, December 14, 2023 4:42 PM To: mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; mailto:saloni.kasbekar@intel.com <mailto:saloni.kasbekar@intel.com>; mailto:zachary.clark-williams@intel.com <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Cc: Ashish Singhal <mailto: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 <mailto:ashishsingha@nvidia.com> --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, Hello Saloni, Thanks -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114021): https://edk2.groups.io/g/devel/message/114021 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 17694 bytes --] ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 2024-01-19 1:53 ` Ashish Singhal via groups.io @ 2024-01-19 1:54 ` Ashish Singhal via groups.io 2024-01-19 3:38 ` Michael D Kinney 0 siblings, 1 reply; 14+ messages in thread From: Ashish Singhal via groups.io @ 2024-01-19 1:54 UTC (permalink / raw) To: Kinney, Michael D, Kasbekar, Saloni, devel@edk2.groups.io, Clark-williams, Zachary, Jeff Brasen, Gao, Liming [-- Attachment #1: Type: text/plain, Size: 9325 bytes --] Replied too soon. I saw you had already closed mine. Thanks Ashish ________________________________ From: Ashish Singhal <ashishsingha@nvidia.com> Sent: Friday, January 19, 2024 7:23 AM To: Kinney, Michael D <michael.d.kinney@intel.com>; Kasbekar, Saloni <saloni.kasbekar@intel.com>; devel@edk2.groups.io <devel@edk2.groups.io>; Clark-williams, Zachary <zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>; Gao, Liming <gaoliming@byosoft.com.cn> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hi Michael, If you are going to create a new PR yourself instead of using the one I already created (https://github.com/tianocore/edk2/pull/5150), should I close this one? Thanks Ashish ________________________________ From: Kinney, Michael D <michael.d.kinney@intel.com> Sent: Friday, January 19, 2024 4:57 AM To: Kasbekar, Saloni <saloni.kasbekar@intel.com>; Ashish Singhal <ashishsingha@nvidia.com>; devel@edk2.groups.io <devel@edk2.groups.io>; Clark-williams, Zachary <zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>; Gao, Liming <gaoliming@byosoft.com.cn> Cc: Kinney, Michael D <michael.d.kinney@intel.com> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Acked-by: Michael D Kinney <michael.d.kinney@intel.com> I will prepare PR for merge From: Kasbekar, Saloni <saloni.kasbekar@intel.com> Sent: Wednesday, January 17, 2024 9:27 AM To: Ashish Singhal <ashishsingha@nvidia.com>; devel@edk2.groups.io; Clark-williams, Zachary <zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Liming, Mike, Could you please help merge this PR? Thanks, Saloni From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Wednesday, January 17, 2024 6:08 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking back for an update on when this PR can be merged or if there are any other changes you recommend. Thanks Ashish ________________________________________ From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Saturday, January 6, 2024 5:53 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thanks Saloni. PR for getting this merged is available at https://github.com/tianocore/edk2/pull/5150 Thanks Ashish ________________________________________ From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com> Sent: Saturday, January 6, 2024 1:31 AM To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> 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 <mailto:saloni.kasbekar@intel.com> Thanks, Saloni From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Friday, January 5, 2024 2:34 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto: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 goal for reset to default. ________________________________________ From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com> Sent: Friday, January 5, 2024 2:30 AM To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto: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 = TRUE when updating the Policy then? From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Wednesday, January 3, 2024 8:52 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> 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, setting value as static does not have any benefit as it forces to reuse the old network settings. Using DHCP really mimics the reset behavior that we see without any configuration done manually. Thanks Ashish ________________________________________ From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com> Sent: Tuesday, January 2, 2024 1:47 PM To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Hi Ashish, + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we're assuming IfrFormNvData->DhcpEnable is TRUE. Should we check it before setting the policy and calling SetData()? Thanks, Saloni From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Monday, January 1, 2024 8:48 AM To: mailto:devel@edk2.groups.io; Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking again for some feedback on this. Thanks Ashish ________________________________________ From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Thursday, December 14, 2023 4:42 PM To: mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; mailto:saloni.kasbekar@intel.com <mailto:saloni.kasbekar@intel.com>; mailto:zachary.clark-williams@intel.com <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Cc: Ashish Singhal <mailto: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 <mailto:ashishsingha@nvidia.com> --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, Hello Saloni, Thanks -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114022): https://edk2.groups.io/g/devel/message/114022 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 24952 bytes --] ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default 2024-01-19 1:54 ` Ashish Singhal via groups.io @ 2024-01-19 3:38 ` Michael D Kinney 0 siblings, 0 replies; 14+ messages in thread From: Michael D Kinney @ 2024-01-19 3:38 UTC (permalink / raw) To: Ashish Singhal, Kasbekar, Saloni, devel@edk2.groups.io, Clark-williams, Zachary, Jeff Brasen, Gao, Liming Cc: Kinney, Michael D [-- Attachment #1: Type: text/plain, Size: 10651 bytes --] Merged: https://github.com/tianocore/edk2/pull/5274 Mike From: Ashish Singhal <ashishsingha@nvidia.com> Sent: Thursday, January 18, 2024 5:55 PM To: Kinney, Michael D <michael.d.kinney@intel.com>; Kasbekar, Saloni <saloni.kasbekar@intel.com>; devel@edk2.groups.io; Clark-williams, Zachary <zachary.clark-williams@intel.com>; Jeff Brasen <jbrasen@nvidia.com>; Gao, Liming <gaoliming@byosoft.com.cn> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Replied too soon. I saw you had already closed mine. Thanks Ashish ________________________________ From: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>> Sent: Friday, January 19, 2024 7:23 AM To: Kinney, Michael D <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>>; Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>>; Gao, Liming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hi Michael, If you are going to create a new PR yourself instead of using the one I already created (https://github.com/tianocore/edk2/pull/5150), should I close this one? Thanks Ashish ________________________________ From: Kinney, Michael D <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>> Sent: Friday, January 19, 2024 4:57 AM To: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>>; Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>>; Gao, Liming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>> Cc: Kinney, Michael D <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Acked-by: Michael D Kinney <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>> I will prepare PR for merge From: Kasbekar, Saloni <saloni.kasbekar@intel.com<mailto:saloni.kasbekar@intel.com>> Sent: Wednesday, January 17, 2024 9:27 AM To: Ashish Singhal <ashishsingha@nvidia.com<mailto:ashishsingha@nvidia.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Clark-williams, Zachary <zachary.clark-williams@intel.com<mailto:zachary.clark-williams@intel.com>>; Jeff Brasen <jbrasen@nvidia.com<mailto:jbrasen@nvidia.com>>; Kinney, Michael D <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>>; Gao, Liming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Liming, Mike, Could you please help merge this PR? Thanks, Saloni From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Wednesday, January 17, 2024 6:08 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking back for an update on when this PR can be merged or if there are any other changes you recommend. Thanks Ashish ________________________________________ From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Saturday, January 6, 2024 5:53 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thanks Saloni. PR for getting this merged is available at https://github.com/tianocore/edk2/pull/5150 Thanks Ashish ________________________________________ From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com> Sent: Saturday, January 6, 2024 1:31 AM To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> 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 <mailto:saloni.kasbekar@intel.com> Thanks, Saloni From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Friday, January 5, 2024 2:34 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto: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 goal for reset to default. ________________________________________ From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com> Sent: Friday, January 5, 2024 2:30 AM To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto: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 = TRUE when updating the Policy then? From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Wednesday, January 3, 2024 8:52 AM To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> 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, setting value as static does not have any benefit as it forces to reuse the old network settings. Using DHCP really mimics the reset behavior that we see without any configuration done manually. Thanks Ashish ________________________________________ From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com> Sent: Tuesday, January 2, 2024 1:47 PM To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Hi Ashish, + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we're assuming IfrFormNvData->DhcpEnable is TRUE. Should we check it before setting the policy and calling SetData()? Thanks, Saloni From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Monday, January 1, 2024 8:48 AM To: mailto:devel@edk2.groups.io; Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking again for some feedback on this. Thanks Ashish ________________________________________ From: Ashish Singhal <mailto:ashishsingha@nvidia.com> Sent: Thursday, December 14, 2023 4:42 PM To: mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; mailto:saloni.kasbekar@intel.com <mailto:saloni.kasbekar@intel.com>; mailto:zachary.clark-williams@intel.com <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com> Cc: Ashish Singhal <mailto: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 <mailto:ashishsingha@nvidia.com> --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure != TRUE) { + if (Ip4NvData->DnsAddress != NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress = NULL; + Ip4NvData->DnsAddressCount = 0; + } + + if (Ip4NvData->GatewayAddress != NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress = NULL; + Ip4NvData->GatewayAddressCount = 0; + } + + if (Ip4NvData->ManualAddress != NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress = NULL; + Ip4NvData->ManualAddressCount = 0; + } + + Ip4NvData->Policy = Ip4Config2PolicyDhcp; + Status = Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, Hello Saloni, Thanks -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114023): https://edk2.groups.io/g/devel/message/114023 Mute This Topic: https://groups.io/mt/103181314/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 22064 bytes --] ^ permalink raw reply related [flat|nested] 14+ messages in thread
end of thread, other threads:[~2024-01-19 3:39 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-12-14 23:42 [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Ashish Singhal via groups.io 2024-01-01 16:47 ` Ashish Singhal via groups.io 2024-01-02 20:47 ` Saloni Kasbekar 2024-01-03 16:51 ` Ashish Singhal via groups.io 2024-01-04 21:00 ` Saloni Kasbekar 2024-01-05 10:34 ` Ashish Singhal via groups.io 2024-01-05 20:01 ` Saloni Kasbekar 2024-01-06 0:23 ` Ashish Singhal via groups.io 2024-01-17 14:07 ` Ashish Singhal via groups.io 2024-01-17 17:27 ` Saloni Kasbekar 2024-01-18 23:27 ` Michael D Kinney 2024-01-19 1:53 ` Ashish Singhal via groups.io 2024-01-19 1:54 ` Ashish Singhal via groups.io 2024-01-19 3:38 ` Michael D Kinney
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox