]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
style nits (mostly line length)
authorEvan Hunt <each@isc.org>
Fri, 18 May 2018 20:35:03 +0000 (13:35 -0700)
committerWitold Kręcicki <wpk@isc.org>
Tue, 12 Jun 2018 07:18:47 +0000 (09:18 +0200)
lib/dns/adb.c
lib/dns/include/dns/resolver.h
lib/dns/resolver.c
lib/ns/query.c

index adcf733b5185de1735a46e9790482171175624ee..e7d3e3ee7d3678b93148b8aa4bc86efe32c30a8e 100644 (file)
@@ -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;
                }
index 4be589fceb36f815e09cff6386876a5870102f06..daec139fbeaeb354f4bb43b3ded0c41384ed0b5f 100644 (file)
@@ -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 */
index e1c175349886e4d576d99c65dec5f23beceec795..f8b8e3950541e2ff7fb12a92b646333224a6af53 100644 (file)
@@ -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 {
index 037bc0653df96930accc5cdf60800bfca3e14925..c31f398592cd0c1eed70580c06694cbd7f221752 100644 (file)
@@ -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;
                }
        }