From: Mark Andrews Date: Tue, 24 Nov 2009 03:15:54 +0000 (+0000) Subject: 2783. [func] Return minimal responses to EDNS/UDP queries with a UDP X-Git-Tag: v9.5.2-P1~1^8~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bec6b4b55f8533a191bb04cb3aa30322d94643c9;p=thirdparty%2Fbind9.git 2783. [func] Return minimal responses to EDNS/UDP queries with a UDP buffer size of 512 or less. [RT #20654] --- diff --git a/CHANGES b/CHANGES index cba11b12ccd..f57123f1f40 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2783. [func] Return minimal responses to EDNS/UDP queries with a UDP + buffer size of 512 or less. [RT #20654] + 2782. [port] win32: use getaddrinfo() for hostname lookups. [RT #20650] diff --git a/bin/named/query.c b/bin/named/query.c index b82b2164b18..6a69a099a36 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.298.48.17 2009/11/18 00:08:59 marka Exp $ */ +/* $Id: query.c,v 1.298.48.18 2009/11/24 03:15:54 marka Exp $ */ /*! \file */ @@ -4727,6 +4727,14 @@ ns_query_start(ns_client_t *client) { client->query.attributes |= (NS_QUERYATTR_NOAUTHORITY | NS_QUERYATTR_NOADDITIONAL); + /* + * Turn on minimal responses for EDNS/UDP bufsize 512 queries. + */ + if (client->opt != NULL && client->udpsize <= 512U && + (client->attributes & NS_CLIENTATTR_TCP) == 0) + client->query.attributes |= (NS_QUERYATTR_NOAUTHORITY | + NS_QUERYATTR_NOADDITIONAL); + /* * If the client has requested that DNSSEC checking be disabled, * allow lookups to return pending data and instruct the resolver