Commit c8015eb3 authored by Evan Hunt's avatar Evan Hunt Committed by Witold Krecicki
Browse files

style nits (mostly line length)

parent 2ea47c7f
......@@ -4032,7 +4032,7 @@ fetch_name(dns_adbname_t *adbname, isc_boolean_t start_at_zone,
if (adb->view->qminimization) {
options |= DNS_FETCHOPT_QMINIMIZE;
options |= DNS_FETCHOPT_QMIN_SKIP_ON_IP6A;
options |= DNS_FETCHOPT_QMIN_SKIP_IP6A;
if (adb->view->qmin_strict) {
options |= DNS_FETCHOPT_QMIN_STRICT;
}
......
......@@ -105,12 +105,15 @@ typedef enum {
/* RESERVED ECS 0x2000 */
/* RESERVED TCPCLIENT 0x4000 */
#define DNS_FETCHOPT_NOCACHED 0x8000 /*%< Force cache update. */
#define DNS_FETCHOPT_QMINIMIZE 0x00010000 /*%< Use qname minimization. */
#define DNS_FETCHOPT_QMIN_STRICT 0x00020000 /*%< Do not work around servers that
return errors on non-empty
#define DNS_FETCHOPT_QMINIMIZE 0x00010000 /*%< Use qname
minimization. */
#define DNS_FETCHOPT_QMIN_STRICT 0x00020000 /*%< Do not work around
servers that return
errors on non-empty
terminals. */
#define DNS_FETCHOPT_QMIN_SKIP_ON_IP6A 0x00040000 /*%< Skip some labels when
doing qname minimization on
#define DNS_FETCHOPT_QMIN_SKIP_IP6A 0x00040000 /*%< Skip some labels
when doing qname
minimization on
ip6.arpa. */
/* Reserved in use by adb.c 0x00400000 */
......
......@@ -2973,7 +2973,8 @@ resquery_connected(isc_task_t *task, isc_event_t *event) {
FCTXTRACE("query canceled: "
"resquery_send() failed; responding");
fctx_cancelquery(&query, NULL, NULL, ISC_FALSE, ISC_FALSE);
fctx_cancelquery(&query, NULL, NULL,
ISC_FALSE, ISC_FALSE);
fctx_done(fctx, result, __LINE__);
}
break;
......@@ -2992,7 +2993,8 @@ resquery_connected(isc_task_t *task, isc_event_t *event) {
* No route to remote.
*/
isc_socket_detach(&query->tcpsocket);
fctx_cancelquery(&query, NULL, NULL, ISC_TRUE, ISC_FALSE);
fctx_cancelquery(&query, NULL, NULL,
ISC_TRUE, ISC_FALSE);
retry = ISC_TRUE;
break;
......@@ -3002,7 +3004,8 @@ resquery_connected(isc_task_t *task, isc_event_t *event) {
sevent->result);
isc_socket_detach(&query->tcpsocket);
fctx_cancelquery(&query, NULL, NULL, ISC_FALSE, ISC_FALSE);
fctx_cancelquery(&query, NULL, NULL,
ISC_FALSE, ISC_FALSE);
break;
}
}
......@@ -4759,8 +4762,10 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
* If qname minimization is enabled we need to trim
* the name in fctx to proper length.
*/
if (options & DNS_FETCHOPT_QMINIMIZE) {
fctx->ip6arpaskip = (options & DNS_FETCHOPT_QMIN_SKIP_ON_IP6A) && dns_name_issubdomain(&fctx->name, &ip6_arpa);
if ((options & DNS_FETCHOPT_QMINIMIZE) != 0) {
fctx->ip6arpaskip =
ISC_TF((options & DNS_FETCHOPT_QMIN_SKIP_IP6A) != 0 &&
dns_name_issubdomain(&fctx->name, &ip6_arpa));
fctx_minimize_qname(fctx);
}
......@@ -8502,15 +8507,18 @@ rctx_answer_none(respctx_t *rctx) {
* If we're minimizing in relaxed mode, retry with full name,
* just to be safe. The error will be logged.
*/
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, "XXX %d %d", fctx->minimized, fctx->options & DNS_FETCHOPT_QMIN_STRICT);
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO,
"XXX %d %d", fctx->minimized,
fctx->options & DNS_FETCHOPT_QMIN_STRICT);
if (fctx->minimized &&
!(fctx->options & DNS_FETCHOPT_QMIN_STRICT)) {
(fctx->options & DNS_FETCHOPT_QMIN_STRICT) == 0) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO,
"disabling qname minimization for '%s'"
" due to formerr", fctx->info);
fctx->qmin_labels = DNS_MAX_LABELS+1;
return rctx_answer_minimized(rctx);
"disabling qname minimization for '%s' "
"due to formerr", fctx->info);
fctx->qmin_labels = DNS_MAX_LABELS + 1;
return (rctx_answer_minimized(rctx));
}
return (DNS_R_FORMERR);
}
......@@ -10274,7 +10282,10 @@ log_fetch(const dns_name_t *name, dns_rdatatype_t type) {
void
fctx_minimize_qname(fetchctx_t *fctx) {
/* XXXWPK TODO we should update info to show that this query is minimized */
/*
* XXXWPK TODO we should update info to show that this query
* is minimized
*/
unsigned int dlabels, nlabels;
dlabels = dns_name_countlabels(&fctx->domain);
......@@ -10283,9 +10294,9 @@ fctx_minimize_qname(fetchctx_t *fctx) {
dns_name_init(&fctx->name, NULL);
if (fctx->ip6arpaskip) {
/*
* For ip6.arpa we want to skip some of the labels, with boundaries
* at /16, /32, /48, /56, /64 and /128
* in 'label count' terms that's equal to
* For ip6.arpa we want to skip some of the labels, with
* boundaries at /16, /32, /48, /56, /64 and /128
* In 'label count' terms that's equal to
* 7 11 15 17 19 35
* We fix fctx->qmin_labels to point to the nearest boundary
*/
......@@ -10309,14 +10320,16 @@ fctx_minimize_qname(fetchctx_t *fctx) {
}
if (dlabels + fctx->qmin_labels < nlabels) {
/*
* We want to query for [qmin_labels from fctx->fullname] + fctx->domain
* We want to query for
* [qmin_labels from fctx->fullname] + fctx->domain
*/
dns_fixedname_t fname;
dns_fixedname_init(&fname);
dns_name_split(&fctx->fullname,
dlabels + fctx->qmin_labels,
NULL, dns_fixedname_name(&fname));
dns_name_dup(dns_fixedname_name(&fname), fctx->mctx, &fctx->name);
dns_name_dup(dns_fixedname_name(&fname), fctx->mctx,
&fctx->name);
fctx->type = dns_rdatatype_ns;
fctx->minimized = isc_boolean_true;
} else {
......
......@@ -11108,10 +11108,9 @@ ns_query_start(ns_client_t *client) {
if (client->view->qminimization) {
client->query.fetchoptions |= DNS_FETCHOPT_QMINIMIZE |
DNS_FETCHOPT_QMIN_SKIP_ON_IP6A;
DNS_FETCHOPT_QMIN_SKIP_IP6A;
if (client->view->qmin_strict) {
client->query.fetchoptions |=
DNS_FETCHOPT_QMIN_STRICT;
client->query.fetchoptions |= DNS_FETCHOPT_QMIN_STRICT;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment