Re: [edk2] [PATCH v2] NetworkPkg/Ip6Dxe: Clean the invalid IPv6 configuration during driver start.

2019-02-13 Thread Wu, Jiaxin
Hi Siyuan,

Both of them should be fine to clear the invalid configuration data. In my 
opinion, since the error returned from SetData(), we will treat it as invalid 
except the asynchronous process (EFI_NOT_READY). That's already have been 
checked in the if condition.

Thanks,
Jiaxin


> -Original Message-
> From: Fu, Siyuan
> Sent: Tuesday, February 12, 2019 9:05 AM
> To: Wu, Jiaxin ; edk2-devel@lists.01.org
> Cc: Michael Turner ; Ye, Ting
> 
> Subject: RE: [PATCH v2] NetworkPkg/Ip6Dxe: Clean the invalid IPv6
> configuration during driver start.
> 
> Hi, Jiaxin
> 
> I think the Ip6Cfg->SetData() may return other error, which not only because
> invalid config data is used. Why not just check the config data in
> Ip6ConfigReadConfigData()?
> 
> BestRegards
> Fu Siyuan
> 
> 
> > -Original Message-
> > From: Wu, Jiaxin
> > Sent: Tuesday, February 12, 2019 8:47 AM
> > To: edk2-devel@lists.01.org
> > Cc: Michael Turner ; Ye, Ting
> > ; Fu, Siyuan ; Wu, Jiaxin
> > 
> > Subject: [PATCH v2] NetworkPkg/Ip6Dxe: Clean the invalid IPv6
> configuration
> > during driver start.
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1448
> >
> > *v2: Add the warning debug message.
> >
> > This patch is to clean the invalid data and continue to start IP6 driver.
> >
> > Cc: Michael Turner 
> > Cc: Ye Ting 
> > Cc: Fu Siyuan 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Wu Jiaxin 
> > ---
> >  NetworkPkg/Ip6Dxe/Ip6Driver.c | 22 --
> >  1 file changed, 20 insertions(+), 2 deletions(-)
> >
> > diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.c
> b/NetworkPkg/Ip6Dxe/Ip6Driver.c
> > index 4c607125a6..7ec74f6ebc 100644
> > --- a/NetworkPkg/Ip6Dxe/Ip6Driver.c
> > +++ b/NetworkPkg/Ip6Dxe/Ip6Driver.c
> > @@ -586,11 +586,20 @@ Ip6DriverBindingStart (
> > Ip6ConfigDataTypeManualAddress,
> > DataItem->DataSize,
> > DataItem->Data.Ptr
> > );
> >  if (EFI_ERROR(Status) && Status != EFI_NOT_READY) {
> > -  goto UNINSTALL_PROTOCOL;
> > +  //
> > +  // 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.
> > @@ -602,11 +611,20 @@ Ip6DriverBindingStart (
> > Ip6ConfigDataTypeGateway,
> > DataItem->DataSize,
> > DataItem->Data.Ptr
> > );
> >  if (EFI_ERROR(Status)) {
> > -  goto UNINSTALL_PROTOCOL;
> > +  //
> > +  // 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

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2] NetworkPkg/Ip6Dxe: Clean the invalid IPv6 configuration during driver start.

2019-02-11 Thread Fu, Siyuan
Hi, Jiaxin

I think the Ip6Cfg->SetData() may return other error, which not only because 
invalid config data is used. Why not just check the config data in 
Ip6ConfigReadConfigData()?

BestRegards
Fu Siyuan


> -Original Message-
> From: Wu, Jiaxin
> Sent: Tuesday, February 12, 2019 8:47 AM
> To: edk2-devel@lists.01.org
> Cc: Michael Turner ; Ye, Ting
> ; Fu, Siyuan ; Wu, Jiaxin
> 
> Subject: [PATCH v2] NetworkPkg/Ip6Dxe: Clean the invalid IPv6 configuration
> during driver start.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1448
> 
> *v2: Add the warning debug message.
> 
> This patch is to clean the invalid data and continue to start IP6 driver.
> 
> Cc: Michael Turner 
> Cc: Ye Ting 
> Cc: Fu Siyuan 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin 
> ---
>  NetworkPkg/Ip6Dxe/Ip6Driver.c | 22 --
>  1 file changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.c b/NetworkPkg/Ip6Dxe/Ip6Driver.c
> index 4c607125a6..7ec74f6ebc 100644
> --- a/NetworkPkg/Ip6Dxe/Ip6Driver.c
> +++ b/NetworkPkg/Ip6Dxe/Ip6Driver.c
> @@ -586,11 +586,20 @@ Ip6DriverBindingStart (
> Ip6ConfigDataTypeManualAddress,
> DataItem->DataSize,
> DataItem->Data.Ptr
> );
>  if (EFI_ERROR(Status) && Status != EFI_NOT_READY) {
> -  goto UNINSTALL_PROTOCOL;
> +  //
> +  // 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.
> @@ -602,11 +611,20 @@ Ip6DriverBindingStart (
> Ip6ConfigDataTypeGateway,
> DataItem->DataSize,
> DataItem->Data.Ptr
> );
>  if (EFI_ERROR(Status)) {
> -  goto UNINSTALL_PROTOCOL;
> +  //
> +  // 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

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2] NetworkPkg/Ip6Dxe: Clean the invalid IPv6 configuration during driver start.

2019-02-11 Thread Jiaxin Wu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1448

*v2: Add the warning debug message.

This patch is to clean the invalid data and continue to start IP6 driver.

Cc: Michael Turner 
Cc: Ye Ting 
Cc: Fu Siyuan 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin 
---
 NetworkPkg/Ip6Dxe/Ip6Driver.c | 22 --
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.c b/NetworkPkg/Ip6Dxe/Ip6Driver.c
index 4c607125a6..7ec74f6ebc 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Driver.c
+++ b/NetworkPkg/Ip6Dxe/Ip6Driver.c
@@ -586,11 +586,20 @@ Ip6DriverBindingStart (
Ip6ConfigDataTypeManualAddress,
DataItem->DataSize,
DataItem->Data.Ptr
);
 if (EFI_ERROR(Status) && Status != EFI_NOT_READY) {
-  goto UNINSTALL_PROTOCOL;
+  //
+  // 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.
@@ -602,11 +611,20 @@ Ip6DriverBindingStart (
Ip6ConfigDataTypeGateway,
DataItem->DataSize,
DataItem->Data.Ptr
);
 if (EFI_ERROR(Status)) {
-  goto UNINSTALL_PROTOCOL;
+  //
+  // 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

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel