]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/DnsDxe/DnsImpl.c
NetworkPkg: Replace the internal function with exposed one
[mirror_edk2.git] / NetworkPkg / DnsDxe / DnsImpl.c
index 617e623286d86f448b77e224735c62cae6afc4d9..19184415e5c5d0e0e8d79dfe8f75338239ccd12b 100644 (file)
@@ -1037,61 +1037,6 @@ AddDns6ServerIp (
   return EFI_SUCCESS;\r
 }\r
 \r
-/**\r
-  Fill QName for IP querying. QName is a domain name represented as \r
-  a sequence of labels, where each label consists of a length octet \r
-  followed by that number of octets. The domain name terminates with \r
-  the zero length octet for the null label of the root. Caller should \r
-  take responsibility to the buffer in QName.\r
-\r
-  @param  HostName          Queried HostName    \r
-\r
-  @retval NULL      Failed to fill QName.\r
-  @return           QName filled successfully.\r
-  \r
-**/ \r
-CHAR8 *\r
-EFIAPI\r
-DnsFillinQNameForQueryIp (\r
-  IN  CHAR16              *HostName\r
-  )\r
-{\r
-  CHAR8                 *QueryName;\r
-  CHAR8                 *Header;\r
-  CHAR8                 *Tail;\r
-  UINTN                 Len;\r
-  UINTN                 Index;\r
-\r
-  QueryName  = NULL;\r
-  Header     = NULL;\r
-  Tail       = NULL;\r
-\r
-  QueryName = AllocateZeroPool (DNS_DEFAULT_BLKSIZE);\r
-  if (QueryName == NULL) {\r
-    return NULL;\r
-  }\r
-  \r
-  Header = QueryName;\r
-  Tail = Header + 1;\r
-  Len = 0;\r
-  for (Index = 0; HostName[Index] != 0; Index++) {\r
-    *Tail = (CHAR8) HostName[Index];\r
-    if (*Tail == '.') {\r
-      *Header = (CHAR8) Len;\r
-      Header = Tail;\r
-      Tail ++;\r
-      Len = 0;\r
-    } else {\r
-      Tail++;\r
-      Len++;\r
-    }\r
-  }\r
-  *Header = (CHAR8) Len;\r
-  *Tail = 0;\r
-\r
-  return QueryName;\r
-}\r
-\r
 /**\r
   Find out whether the response is valid or invalid.\r
 \r
@@ -1806,8 +1751,12 @@ ConstructDNSQuery (
   NET_FRAGMENT        Frag;\r
   DNS_HEADER          *DnsHeader;\r
   DNS_QUERY_SECTION   *DnsQuery;\r
-  \r
-  Frag.Bulk = AllocatePool (DNS_DEFAULT_BLKSIZE * sizeof (UINT8));\r
+\r
+  //\r
+  // Messages carried by UDP are restricted to 512 bytes (not counting the IP\r
+  // or UDP headers).\r
+  //\r
+  Frag.Bulk = AllocatePool (DNS_MAX_MESSAGE_SIZE * sizeof (UINT8));\r
   if (Frag.Bulk == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r