/** @file\r
DnsDxe support functions implementation.\r
\r
-Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
FreePool (Ip6Mode.IcmpTypeList);\r
}\r
\r
- if (Ip6Mode.IsConfigured) {\r
+ if (!Ip6Mode.IsStarted || Ip6Mode.IsConfigured) {\r
Udp->Configure (Udp, NULL);\r
- return (BOOLEAN) (Udp->Configure (Udp, UdpCfgData) == EFI_SUCCESS);\r
+ if (Udp->Configure (Udp, UdpCfgData) == EFI_SUCCESS) {\r
+ return TRUE;\r
+ }\r
}\r
}\r
}\r
//\r
while (AnswerSectionNum < DnsHeader->AnswersNum) {\r
//\r
- // Answer name should be PTR.\r
+ // Answer name should be PTR, else EFI_UNSUPPORTED returned.\r
//\r
- ASSERT ((*(UINT8 *) AnswerName & 0xC0) == 0xC0);\r
+ if ((*(UINT8 *) AnswerName & 0xC0) != 0xC0) {\r
+ Status = EFI_UNSUPPORTED;\r
+ goto ON_EXIT;\r
+ }\r
\r
//\r
// Get Answer section.\r
//\r
// This is address entry, get Data.\r
//\r
- ASSERT (Dns4TokenEntry != NULL && AnswerSection->DataLength == 4);\r
+ ASSERT (Dns4TokenEntry != NULL);\r
+\r
+ if (AnswerSection->DataLength != 4) {\r
+ Status = EFI_ABORTED;\r
+ goto ON_EXIT;\r
+ }\r
\r
HostAddr4 = Dns4TokenEntry->Token->RspData.H2AData->IpList;\r
AnswerData = (UINT8 *) AnswerSection + sizeof (*AnswerSection);\r
//\r
// This is address entry, get Data.\r
//\r
- ASSERT (Dns6TokenEntry != NULL && AnswerSection->DataLength == 16);\r
+ ASSERT (Dns6TokenEntry != NULL);\r
+\r
+ if (AnswerSection->DataLength != 16) {\r
+ Status = EFI_ABORTED;\r
+ goto ON_EXIT;\r
+ }\r
\r
HostAddr6 = Dns6TokenEntry->Token->RspData.H2AData->IpList;\r
AnswerData = (UINT8 *) AnswerSection + sizeof (*AnswerSection);\r