diff options
author | Jiaxin Wu <Jiaxin.wu@intel.com> | 2019-01-30 11:24:27 +0800 |
---|---|---|
committer | Jiaxin Wu <Jiaxin.wu@intel.com> | 2019-02-19 08:31:15 +0800 |
commit | a169a04fd2cd529527f21575131ba3379ab72df8 (patch) | |
tree | 2151caaf536f2150c26d43733c0debc7a952f3b6 /NetworkPkg | |
parent | c417c1b33d06ef6ae96adb373201a5a3c3b38772 (diff) | |
download | edk2-a169a04fd2cd529527f21575131ba3379ab72df8.tar.gz edk2-a169a04fd2cd529527f21575131ba3379ab72df8.tar.bz2 edk2-a169a04fd2cd529527f21575131ba3379ab72df8.zip |
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>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
Diffstat (limited to 'NetworkPkg')
-rw-r--r-- | NetworkPkg/Ip6Dxe/Ip6Driver.c | 26 |
1 files 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 @@ -587,8 +587,17 @@ Ip6DriverBindingStart ( 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"));
}
}
@@ -603,8 +612,17 @@ Ip6DriverBindingStart ( 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"));
}
}
|