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