* [PATCH v3] NetworkPkg/Ip6Dxe: Clean the invalid IPv6 configuration during driver start.
@ 2019-02-18 1:14 Jiaxin Wu
2019-02-18 1:33 ` Fu, Siyuan
0 siblings, 1 reply; 2+ messages in thread
From: Jiaxin Wu @ 2019-02-18 1:14 UTC (permalink / raw)
To: edk2-devel; +Cc: Michael Turner, Ye Ting, Fu Siyuan, Wu Jiaxin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1448
*v3: Change the if condition check to only clean the invalid configuration.
*v2: Add the warning debug message.
This patch is to clean the invalid data and continue to start IP6 driver.
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
NetworkPkg/Ip6Dxe/Ip6Driver.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.c b/NetworkPkg/Ip6Dxe/Ip6Driver.c
index 4c607125a6..7a96315ccf 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Driver.c
+++ b/NetworkPkg/Ip6Dxe/Ip6Driver.c
@@ -585,12 +585,21 @@ Ip6DriverBindingStart (
Ip6Cfg,
Ip6ConfigDataTypeManualAddress,
DataItem->DataSize,
DataItem->Data.Ptr
);
- if (EFI_ERROR(Status) && Status != EFI_NOT_READY) {
- goto UNINSTALL_PROTOCOL;
+ if (Status == EFI_INVALID_PARAMETER || Status == EFI_BAD_BUFFER_SIZE) {
+ //
+ // Clean the invalid ManualAddress configuration.
+ //
+ Status = Ip6Cfg->SetData (
+ Ip6Cfg,
+ Ip6ConfigDataTypeManualAddress,
+ 0,
+ NULL
+ );
+ DEBUG ((EFI_D_WARN, "Ip6DriverBindingStart: Clean the invalid ManualAddress configuration.\n"));
}
}
//
// If there is any default gateway address, set it.
@@ -601,12 +610,21 @@ Ip6DriverBindingStart (
Ip6Cfg,
Ip6ConfigDataTypeGateway,
DataItem->DataSize,
DataItem->Data.Ptr
);
- if (EFI_ERROR(Status)) {
- goto UNINSTALL_PROTOCOL;
+ if (Status == EFI_INVALID_PARAMETER || Status == EFI_BAD_BUFFER_SIZE) {
+ //
+ // Clean the invalid Gateway configuration.
+ //
+ Status = Ip6Cfg->SetData (
+ Ip6Cfg,
+ Ip6ConfigDataTypeGateway,
+ 0,
+ NULL
+ );
+ DEBUG ((EFI_D_WARN, "Ip6DriverBindingStart: Clean the invalid Gateway configuration.\n"));
}
}
//
// ready to go: start the receiving and timer
--
2.17.1.windows.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3] NetworkPkg/Ip6Dxe: Clean the invalid IPv6 configuration during driver start.
2019-02-18 1:14 [PATCH v3] NetworkPkg/Ip6Dxe: Clean the invalid IPv6 configuration during driver start Jiaxin Wu
@ 2019-02-18 1:33 ` Fu, Siyuan
0 siblings, 0 replies; 2+ messages in thread
From: Fu, Siyuan @ 2019-02-18 1:33 UTC (permalink / raw)
To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Michael Turner, Ye, Ting
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
> -----Original Message-----
> From: Wu, Jiaxin
> Sent: Monday, February 18, 2019 9:15 AM
> To: edk2-devel@lists.01.org
> Cc: Michael Turner <Michael.Turner@microsoft.com>; Ye, Ting
> <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin
> <jiaxin.wu@intel.com>
> Subject: [PATCH v3] NetworkPkg/Ip6Dxe: Clean the invalid IPv6 configuration
> during driver start.
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1448
>
> *v3: Change the if condition check to only clean the invalid configuration.
>
> *v2: Add the warning debug message.
>
> This patch is to clean the invalid data and continue to start IP6 driver.
>
> Cc: Michael Turner <Michael.Turner@microsoft.com>
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
> ---
> NetworkPkg/Ip6Dxe/Ip6Driver.c | 26 ++++++++++++++++++++++----
> 1 file changed, 22 insertions(+), 4 deletions(-)
>
> diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.c b/NetworkPkg/Ip6Dxe/Ip6Driver.c
> index 4c607125a6..7a96315ccf 100644
> --- a/NetworkPkg/Ip6Dxe/Ip6Driver.c
> +++ b/NetworkPkg/Ip6Dxe/Ip6Driver.c
> @@ -585,12 +585,21 @@ Ip6DriverBindingStart (
> Ip6Cfg,
> Ip6ConfigDataTypeManualAddress,
> DataItem->DataSize,
> DataItem->Data.Ptr
> );
> - if (EFI_ERROR(Status) && Status != EFI_NOT_READY) {
> - goto UNINSTALL_PROTOCOL;
> + if (Status == EFI_INVALID_PARAMETER || Status == EFI_BAD_BUFFER_SIZE) {
> + //
> + // Clean the invalid ManualAddress configuration.
> + //
> + Status = Ip6Cfg->SetData (
> + Ip6Cfg,
> + Ip6ConfigDataTypeManualAddress,
> + 0,
> + NULL
> + );
> + DEBUG ((EFI_D_WARN, "Ip6DriverBindingStart: Clean the invalid
> ManualAddress configuration.\n"));
> }
> }
>
> //
> // If there is any default gateway address, set it.
> @@ -601,12 +610,21 @@ Ip6DriverBindingStart (
> Ip6Cfg,
> Ip6ConfigDataTypeGateway,
> DataItem->DataSize,
> DataItem->Data.Ptr
> );
> - if (EFI_ERROR(Status)) {
> - goto UNINSTALL_PROTOCOL;
> + if (Status == EFI_INVALID_PARAMETER || Status == EFI_BAD_BUFFER_SIZE) {
> + //
> + // Clean the invalid Gateway configuration.
> + //
> + Status = Ip6Cfg->SetData (
> + Ip6Cfg,
> + Ip6ConfigDataTypeGateway,
> + 0,
> + NULL
> + );
> + DEBUG ((EFI_D_WARN, "Ip6DriverBindingStart: Clean the invalid Gateway
> configuration.\n"));
> }
> }
>
> //
> // ready to go: start the receiving and timer
> --
> 2.17.1.windows.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-18 1:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-18 1:14 [PATCH v3] NetworkPkg/Ip6Dxe: Clean the invalid IPv6 configuration during driver start Jiaxin Wu
2019-02-18 1:33 ` Fu, Siyuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox