/* Destroy the Dhcp6 child in IP6_CONFIG_INSTANCE and release the resources. */
EFI_STATUS Ip6ConfigDestroyDhcp6(IN OUT IP6_CONFIG_INSTANCE *Instance)
/* Destroy the Dhcp6 child in IP6_CONFIG_INSTANCE and release the resources. */
EFI_STATUS Ip6ConfigDestroyDhcp6(IN OUT IP6_CONFIG_INSTANCE *Instance)
{
  IP6_SERVICE         *IpSb;
  EFI_STATUS          Status;
  EFI_DHCP6_PROTOCOL  *Dhcp6;
  Dhcp6 = Instance->Dhcp6;
  ASSERT (Dhcp6 != NULL);
  Dhcp6->Stop (Dhcp6);
  Dhcp6->Configure (Dhcp6, NULL);
  Instance->Dhcp6 = NULL;
  IpSb = IP6_SERVICE_FROM_IP6_CONFIG_INSTANCE (Instance);
  Status = gBS->CloseProtocol (
                  Instance->Dhcp6Handle,
                  &gEfiDhcp6ProtocolGuid,
                  IpSb->Image,
                  IpSb->Controller
                  );
  if (EFI_ERROR (Status)) {
    return Status;
  }
  Status = NetLibDestroyServiceChild (
             IpSb->Controller,
             IpSb->Image,
             &gEfiDhcp6ServiceBindingProtocolGuid,
             Instance->Dhcp6Handle
             );
  Instance->Dhcp6Handle = NULL;
  return Status;
}