2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

optimization: when deciding whether to do v6 syntheis, check the query type

before the ACL because it's usually faster that way
This commit is contained in:
Andreas Gustafsson
2001-01-26 23:40:44 +00:00
parent dd66e6306b
commit 75534b6392

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: query.c,v 1.176 2001/01/23 01:50:25 bwelling Exp $ */ /* $Id: query.c,v 1.177 2001/01/26 23:40:44 gson Exp $ */
#include <config.h> #include <config.h>
@@ -3403,6 +3403,7 @@ ns_query_start(ns_client_t *client) {
* Synthesize IPv6 responses if appropriate. * Synthesize IPv6 responses if appropriate.
*/ */
if (RECURSIONOK(client) && if (RECURSIONOK(client) &&
(qtype == dns_rdatatype_aaaa || qtype == dns_rdatatype_ptr) &&
client->message->rdclass == dns_rdataclass_in && client->message->rdclass == dns_rdataclass_in &&
ns_client_checkacl(client, "v6 synthesis", ns_client_checkacl(client, "v6 synthesis",
client->view->v6synthesisacl, client->view->v6synthesisacl,
@@ -3413,14 +3414,16 @@ ns_query_start(ns_client_t *client) {
ns_client_attach(client, &qclient); ns_client_attach(client, &qclient);
synth_fwd_start(qclient); synth_fwd_start(qclient);
return; return;
} else if (qtype == dns_rdatatype_ptr && } else {
INSIST(qtype == dns_rdatatype_ptr);
/* Must be 32 nibbles + "ip6" + "int" + root */ /* Must be 32 nibbles + "ip6" + "int" + root */
dns_name_countlabels(client->query.qname) == 32 + 3 && if (dns_name_countlabels(client->query.qname) == 32 + 3 &&
dns_name_issubdomain(client->query.qname, &ip6int_name)) { dns_name_issubdomain(client->query.qname, &ip6int_name)) {
qclient = NULL; qclient = NULL;
ns_client_attach(client, &qclient); ns_client_attach(client, &qclient);
synth_rev_start(qclient); synth_rev_start(qclient);
return; return;
}
} }
} }