#define WANTRECURSION(c) (((c)->query.attributes & \
NS_QUERYATTR_WANTRECURSION) != 0)
/*% Is TCP? */
-#define TCP(c) (((c)->attributes & NS_CLIENTATTR_TCP) != 0)
+#define TCP(c) (((c)->attributes & NS_CLIENTATTR_TCP) != 0)
/*% Want DNSSEC? */
#define WANTDNSSEC(c) (((c)->attributes & \
tmprdataset = query_newrdataset(client);
if (tmprdataset == NULL)
return;
- if ((client->attributes & NS_CLIENTATTR_TCP) == 0)
+ if (!TCP(client))
peeraddr = &client->peeraddr;
else
peeraddr = NULL;
ns_client_killoldestquery(client);
}
if (result == ISC_R_SUCCESS && !client->mortal &&
- (client->attributes & NS_CLIENTATTR_TCP) == 0) {
+ !TCP(client)) {
result = ns_client_replace(client);
if (result != ISC_R_SUCCESS) {
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
if (client->query.timerset == ISC_FALSE)
ns_client_settimeout(client, 60);
- if ((client->attributes & NS_CLIENTATTR_TCP) == 0)
+ if (!TCP(client))
peeraddr = &client->peeraddr;
else
peeraddr = NULL;
client->query.authdbset = ISC_TRUE;
/* Track TCP vs UDP stats per zone */
- if ((client->attributes & NS_CLIENTATTR_TCP) != 0)
+ if (TCP(client))
inc_stats(client, dns_nsstatscounter_tcp);
else
inc_stats(client, dns_nsstatscounter_udp);
resp_result = ISC_R_SUCCESS;
}
rrl_result = dns_rrl(client->view, &client->peeraddr,
- ISC_TF((client->attributes
- & NS_CLIENTATTR_TCP) != 0),
- client->message->rdclass, qtype, tname,
- resp_result, client->now,
+ TCP(client), client->message->rdclass,
+ qtype, tname, resp_result, client->now,
wouldlog, log_buf, sizeof(log_buf));
if (rrl_result != DNS_RRL_RESULT_OK) {
/*
if (rpz_st->m.policy != DNS_RPZ_POLICY_MISS &&
rpz_st->m.policy != DNS_RPZ_POLICY_PASSTHRU &&
(rpz_st->m.policy != DNS_RPZ_POLICY_TCP_ONLY ||
- (client->attributes & NS_CLIENTATTR_TCP) == 0) &&
+ !TCP(client)) &&
rpz_st->m.policy != DNS_RPZ_POLICY_ERROR)
{
/*
classname, typename, WANTRECURSION(client) ? "+" : "-",
(client->signer != NULL) ? "S" : "",
(client->ednsversion >= 0) ? "E" : "",
- ((client->attributes & NS_CLIENTATTR_TCP) != 0) ?
- "T" : "",
+ TCP(client) ? "T" : "",
((extflags & DNS_MESSAGEEXTFLAG_DO) != 0) ? "D" : "",
((flags & DNS_MESSAGEFLAG_CD) != 0) ? "C" : "",
onbuf);
/*
* Turn on minimal responses for EDNS/UDP bufsize 512 queries.
*/
- if (client->ednsversion >= 0 && client->udpsize <= 512U &&
- (client->attributes & NS_CLIENTATTR_TCP) == 0)
+ if (client->ednsversion >= 0 && client->udpsize <= 512U && !TCP(client))
client->query.attributes |= (NS_QUERYATTR_NOAUTHORITY |
NS_QUERYATTR_NOADDITIONAL);