}
}
- /*
- * Allow an additional second for the kernel to resend the SYN
- * (or SYN without ECN in the case of stupid firewalls blocking
- * ECN negotiation) over the current RTT estimate.
- */
- if ((options & DNS_FETCHOPT_TCP) != 0) {
- srtt += US_PER_SEC;
- }
-
- /*
- * A forwarder needs to make multiple queries. Give it at least
- * a second to do these in.
- */
- if (ISFORWARDER(addrinfo) && srtt < US_PER_SEC) {
- srtt = US_PER_SEC;
- }
-
- fctx_setretryinterval(fctx, srtt);
- if (isc_interval_iszero(&fctx->interval)) {
- FCTXTRACE("fetch expired");
- return ISC_R_TIMEDOUT;
- }
-
- INSIST(ISC_LIST_EMPTY(fctx->validators));
-
- query = isc_mem_get(fctx->mctx, sizeof(*query));
- *query = (resquery_t){
- .options = options,
- .addrinfo = addrinfo,
- .dispatchmgr = res->view->dispatchmgr,
- .link = ISC_LINK_INITIALIZER,
- };
-
-#if DNS_RESOLVER_TRACE
- fprintf(stderr, "rctx_init:%s:%s:%d:%p->references = 1\n", __func__,
- __FILE__, __LINE__, query);
-#endif
- isc_refcount_init(&query->references, 1);
-
- /*
- * Note that the caller MUST guarantee that 'addrinfo' will
- * remain valid until this query is canceled.
- */
-
- dns_message_create(fctx->mctx, fctx->res->namepools[fctx->tid],
- fctx->res->rdspools[fctx->tid],
- DNS_MESSAGE_INTENTPARSE, &query->rmessage);
- query->start = isc_time_now();
-
/*
* Maybe apply DNS64 mappings to IPv4 addresses.
*/
sockaddrbuf2, sockaddrbuf1);
}
}
+
+ /*
+ * Check if the address is in the peers list and has a special
+ * confguration.
+ */
if (res->view->peers != NULL) {
dns_peer_t *peer = NULL;
isc_netaddr_t dstip;
}
result = dns_peer_getforcetcp(peer, &usetcp);
if (result == ISC_R_SUCCESS && usetcp) {
- query->options |= DNS_FETCHOPT_TCP;
+ options |= DNS_FETCHOPT_TCP;
}
}
}
+ /*
+ * Allow an additional second for the kernel to resend the SYN
+ * (or SYN without ECN in the case of stupid firewalls blocking
+ * ECN negotiation) over the current RTT estimate.
+ */
+ if ((options & DNS_FETCHOPT_TCP) != 0) {
+ srtt += US_PER_SEC;
+ }
+
+ /*
+ * A forwarder needs to make multiple queries. Give it at least
+ * a second to do these in.
+ */
+ if (ISFORWARDER(addrinfo) && srtt < US_PER_SEC) {
+ srtt = US_PER_SEC;
+ }
+
+ fctx_setretryinterval(fctx, srtt);
+ if (isc_interval_iszero(&fctx->interval)) {
+ FCTXTRACE("fetch expired");
+ return ISC_R_TIMEDOUT;
+ }
+
+ INSIST(ISC_LIST_EMPTY(fctx->validators));
+
+ query = isc_mem_get(fctx->mctx, sizeof(*query));
+ *query = (resquery_t){
+ .options = options,
+ .addrinfo = addrinfo,
+ .dispatchmgr = res->view->dispatchmgr,
+ .link = ISC_LINK_INITIALIZER,
+ };
+
+#if DNS_RESOLVER_TRACE
+ fprintf(stderr, "rctx_init:%s:%s:%d:%p->references = 1\n", __func__,
+ __FILE__, __LINE__, query);
+#endif
+ isc_refcount_init(&query->references, 1);
+
+ /*
+ * Note that the caller MUST guarantee that 'addrinfo' will
+ * remain valid until this query is canceled.
+ */
+
+ dns_message_create(fctx->mctx, fctx->res->namepools[fctx->tid],
+ fctx->res->rdspools[fctx->tid],
+ DNS_MESSAGE_INTENTPARSE, &query->rmessage);
+ query->start = isc_time_now();
+
/*
* If this is a TCP query, then we need to make a socket and
* a dispatch for it here. Otherwise we use the resolver's