mirror of https://github.com/acidanthera/audk.git
NetworkPkg: Clean the previous address since the policy changed
The previous DNS server data will be retained after the policy changes from Auto to Manual. This patch is used to clean the previous dhcp configuration data. Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Subramanian Sriram <sriram-s@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
This commit is contained in:
parent
24b41b75f8
commit
00df35fe41
|
@ -665,36 +665,35 @@ Ip6ConfigSetPolicy (
|
|||
|
||||
return EFI_ABORTED;
|
||||
} else {
|
||||
//
|
||||
// Clean the ManualAddress, Gateway and DnsServers, shrink the variable
|
||||
// data size, and fire up all the related events.
|
||||
//
|
||||
DataItem = &Instance->DataItem[Ip6ConfigDataTypeManualAddress];
|
||||
if (DataItem->Data.Ptr != NULL) {
|
||||
FreePool (DataItem->Data.Ptr);
|
||||
}
|
||||
DataItem->Data.Ptr = NULL;
|
||||
DataItem->DataSize = 0;
|
||||
DataItem->Status = EFI_NOT_FOUND;
|
||||
NetMapIterate (&DataItem->EventMap, Ip6ConfigSignalEvent, NULL);
|
||||
|
||||
if (NewPolicy == Ip6ConfigPolicyAutomatic) {
|
||||
//
|
||||
// Clean the ManualAddress, Gateway and DnsServers, shrink the variable
|
||||
// data size, and fire up all the related events.
|
||||
//
|
||||
DataItem = &Instance->DataItem[Ip6ConfigDataTypeManualAddress];
|
||||
if (DataItem->Data.Ptr != NULL) {
|
||||
FreePool (DataItem->Data.Ptr);
|
||||
}
|
||||
DataItem->Data.Ptr = NULL;
|
||||
DataItem->DataSize = 0;
|
||||
DataItem->Status = EFI_NOT_FOUND;
|
||||
NetMapIterate (&DataItem->EventMap, Ip6ConfigSignalEvent, NULL);
|
||||
DataItem = &Instance->DataItem[Ip6ConfigDataTypeGateway];
|
||||
if (DataItem->Data.Ptr != NULL) {
|
||||
FreePool (DataItem->Data.Ptr);
|
||||
}
|
||||
DataItem->Data.Ptr = NULL;
|
||||
DataItem->DataSize = 0;
|
||||
DataItem->Status = EFI_NOT_FOUND;
|
||||
NetMapIterate (&DataItem->EventMap, Ip6ConfigSignalEvent, NULL);
|
||||
|
||||
DataItem = &Instance->DataItem[Ip6ConfigDataTypeGateway];
|
||||
if (DataItem->Data.Ptr != NULL) {
|
||||
FreePool (DataItem->Data.Ptr);
|
||||
}
|
||||
DataItem->Data.Ptr = NULL;
|
||||
DataItem->DataSize = 0;
|
||||
DataItem->Status = EFI_NOT_FOUND;
|
||||
NetMapIterate (&DataItem->EventMap, Ip6ConfigSignalEvent, NULL);
|
||||
|
||||
DataItem = &Instance->DataItem[Ip6ConfigDataTypeDnsServer];
|
||||
DataItem->Data.Ptr = NULL;
|
||||
DataItem->DataSize = 0;
|
||||
DataItem->Status = EFI_NOT_FOUND;
|
||||
NetMapIterate (&DataItem->EventMap, Ip6ConfigSignalEvent, NULL);
|
||||
} else {
|
||||
DataItem = &Instance->DataItem[Ip6ConfigDataTypeDnsServer];
|
||||
DataItem->Data.Ptr = NULL;
|
||||
DataItem->DataSize = 0;
|
||||
DataItem->Status = EFI_NOT_FOUND;
|
||||
NetMapIterate (&DataItem->EventMap, Ip6ConfigSignalEvent, NULL);
|
||||
|
||||
if (NewPolicy == Ip6ConfigPolicyManual) {
|
||||
//
|
||||
// The policy is changed from automatic to manual. Stop the DHCPv6 process
|
||||
// and destroy the DHCPv6 child.
|
||||
|
|
Loading…
Reference in New Issue