/* The work function is to set the DNS server list for the EFI IPv4 network stack running on the communication device that this EFI_IP4_CONFIG2_PROTOCOL manages. It is not configurable when the policy is Ip4Config2PolicyDhcp. The DNS server addresses must be unicast IPv4 addresses. */
EFI_STATUS Ip4Config2SetDnsServer(IN IP4_CONFIG2_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
/* The work function is to set the DNS server list for the EFI IPv4 network stack running on the communication device that this EFI_IP4_CONFIG2_PROTOCOL manages. It is not configurable when the policy is Ip4Config2PolicyDhcp. The DNS server addresses must be unicast IPv4 addresses. */
EFI_STATUS Ip4Config2SetDnsServer(IN IP4_CONFIG2_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
{
  EFI_STATUS             Status;
  IP4_CONFIG2_DATA_ITEM  *Item;
  Status = EFI_SUCCESS;
  Item   = NULL;
  if (Instance->Policy != Ip4Config2PolicyStatic) {
    return EFI_WRITE_PROTECTED;
  }
  Item = &Instance->DataItem[Ip4Config2DataTypeDnsServer];
  if (DATA_ATTRIB_SET (Item->Attribute, DATA_ATTRIB_VOLATILE)) {
    REMOVE_DATA_ATTRIB (Item->Attribute, DATA_ATTRIB_VOLATILE);
  }
  if ((Data != NULL) && (DataSize != 0)) {
    Status = Ip4Config2SetDnsServerWorker (Instance, DataSize, Data);
  } else {
    if (Item->Data.Ptr != NULL) {
      FreePool (Item->Data.Ptr);
    }
    Item->Data.Ptr = NULL;
    Item->DataSize = 0;
    Item->Status   = EFI_NOT_FOUND;
  }
  return Status;
}