mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 03:59:59 -04:00
remove dns_message_buildopt
now that the EDNS state is stored within dns_message_t, it's no longer necessary to have a public API call to build an opt rdataset; we can just have dns_message_setopt() build the opt record internally.
This commit is contained in:
parent
2d3439ee02
commit
d5e4684b3d
12 changed files with 43 additions and 124 deletions
|
|
@ -2060,7 +2060,6 @@ sendquery(void *arg) {
|
||||||
dns_message_t *message = NULL;
|
dns_message_t *message = NULL;
|
||||||
dns_name_t *query_name = NULL, *mname = NULL;
|
dns_name_t *query_name = NULL, *mname = NULL;
|
||||||
dns_rdataset_t *mrdataset = NULL;
|
dns_rdataset_t *mrdataset = NULL;
|
||||||
dns_rdataset_t *opt = NULL;
|
|
||||||
dns_request_t *request = NULL;
|
dns_request_t *request = NULL;
|
||||||
|
|
||||||
/* Construct query message */
|
/* Construct query message */
|
||||||
|
|
@ -2086,8 +2085,7 @@ sendquery(void *arg) {
|
||||||
mname = NULL;
|
mname = NULL;
|
||||||
|
|
||||||
dns_message_ednsinit(message, 0, 0, DNS_MESSAGEEXTFLAG_DO, 0);
|
dns_message_ednsinit(message, 0, 0, DNS_MESSAGEEXTFLAG_DO, 0);
|
||||||
CHECK(dns_message_buildopt(message, &opt));
|
CHECK(dns_message_setopt(message));
|
||||||
CHECK(dns_message_setopt(message, opt));
|
|
||||||
|
|
||||||
CHECK(dns_requestmgr_create(isc_g_mctx, dispatchmgr, NULL, NULL,
|
CHECK(dns_requestmgr_create(isc_g_mctx, dispatchmgr, NULL, NULL,
|
||||||
&requestmgr));
|
&requestmgr));
|
||||||
|
|
|
||||||
|
|
@ -2115,7 +2115,6 @@ setup_lookup(dig_lookup_t *lookup) {
|
||||||
char cookiebuf[256];
|
char cookiebuf[256];
|
||||||
char *origin = NULL;
|
char *origin = NULL;
|
||||||
char *textname = NULL;
|
char *textname = NULL;
|
||||||
dns_rdataset_t *rdataset = NULL;
|
|
||||||
|
|
||||||
REQUIRE(lookup != NULL);
|
REQUIRE(lookup != NULL);
|
||||||
|
|
||||||
|
|
@ -2564,9 +2563,7 @@ setup_lookup(dig_lookup_t *lookup) {
|
||||||
lookup->padding);
|
lookup->padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
result = dns_message_buildopt(lookup->sendmsg, &rdataset);
|
result = dns_message_setopt(lookup->sendmsg);
|
||||||
check_result(result, "dns_message_buildopt");
|
|
||||||
result = dns_message_setopt(lookup->sendmsg, rdataset);
|
|
||||||
check_result(result, "dns_message_setopt");
|
check_result(result, "dns_message_setopt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1493,7 +1493,6 @@ evaluate_prereq(char *cmdline) {
|
||||||
static void
|
static void
|
||||||
updateopt(void) {
|
updateopt(void) {
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
dns_rdataset_t *opt = NULL;
|
|
||||||
unsigned char ul[8];
|
unsigned char ul[8];
|
||||||
isc_buffer_t b;
|
isc_buffer_t b;
|
||||||
dns_ednsopt_t option = {
|
dns_ednsopt_t option = {
|
||||||
|
|
@ -1512,9 +1511,8 @@ updateopt(void) {
|
||||||
|
|
||||||
dns_message_ednsinit(updatemsg, 0, DEFAULT_EDNS_BUFSIZE, 0, 0);
|
dns_message_ednsinit(updatemsg, 0, DEFAULT_EDNS_BUFSIZE, 0, 0);
|
||||||
dns_message_ednsaddopt(updatemsg, &option);
|
dns_message_ednsaddopt(updatemsg, &option);
|
||||||
result = dns_message_buildopt(updatemsg, &opt);
|
result = dns_message_setopt(updatemsg);
|
||||||
check_result(result, "dns_message_buildopt");
|
check_result(result, "dns_message_setopt");
|
||||||
result = dns_message_setopt(updatemsg, opt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint16_t
|
static uint16_t
|
||||||
|
|
|
||||||
|
|
@ -588,7 +588,6 @@ sendquery(struct query *query) {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
char ecsbuf[20];
|
char ecsbuf[20];
|
||||||
unsigned char cookie[40];
|
unsigned char cookie[40];
|
||||||
dns_rdataset_t *rdataset = NULL;
|
|
||||||
|
|
||||||
flags = query->ednsflags;
|
flags = query->ednsflags;
|
||||||
flags &= ~DNS_MESSAGEEXTFLAG_DO;
|
flags &= ~DNS_MESSAGEEXTFLAG_DO;
|
||||||
|
|
@ -702,9 +701,7 @@ sendquery(struct query *query) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = dns_message_buildopt(message, &rdataset);
|
result = dns_message_setopt(message);
|
||||||
CHECK("dns_message_buildopt", result);
|
|
||||||
result = dns_message_setopt(message, rdataset);
|
|
||||||
CHECK("dns_message_setopt", result);
|
CHECK("dns_message_setopt", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1075,22 +1075,19 @@ dns_message_getopt(dns_message_t *msg);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
dns_message_setopt(dns_message_t *msg, dns_rdataset_t *opt);
|
dns_message_setopt(dns_message_t *msg);
|
||||||
/*%<
|
/*%<
|
||||||
* Set/clear the OPT record for 'msg'.
|
* Constructs an OPT record for 'msg', based on previous calls to
|
||||||
|
* dns_message_ednsinit() and dns_message_ednsaddopt().
|
||||||
*
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
*
|
*
|
||||||
*\li 'msg' is a valid message with rendering intent
|
*\li 'msg' is a valid message with rendering intent,
|
||||||
* and no sections have been rendered.
|
* no sections have been rendered., and dns_message_ednsinit()
|
||||||
*
|
* has been run.
|
||||||
*\li 'opt' is a valid OPT rdataset or NULL.
|
|
||||||
*
|
*
|
||||||
* Ensures:
|
* Ensures:
|
||||||
*
|
*
|
||||||
*\li The OPT record has either been freed or ownership of it has
|
|
||||||
* been transferred to the message.
|
|
||||||
*
|
|
||||||
*\li If ISC_R_SUCCESS was returned, the OPT record will be rendered
|
*\li If ISC_R_SUCCESS was returned, the OPT record will be rendered
|
||||||
* when dns_message_renderend() is called.
|
* when dns_message_renderend() is called.
|
||||||
*
|
*
|
||||||
|
|
@ -1439,21 +1436,6 @@ dns_message_ednsaddopt(dns_message_t *msg, dns_ednsopt_t *ednsopt);
|
||||||
*\li ISC_R_NOSPACE
|
*\li ISC_R_NOSPACE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_result_t
|
|
||||||
dns_message_buildopt(dns_message_t *msg, dns_rdataset_t **opt);
|
|
||||||
|
|
||||||
/*%<
|
|
||||||
* Build an opt record.
|
|
||||||
*
|
|
||||||
* Requires:
|
|
||||||
*\li msg be a valid message.
|
|
||||||
*\li opt to be a non NULL and *opt to be NULL.
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
*\li ISC_R_SUCCESS
|
|
||||||
*\li ISC_R_NOSPACE
|
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
void
|
||||||
dns_message_setclass(dns_message_t *msg, dns_rdataclass_t rdclass);
|
dns_message_setclass(dns_message_t *msg, dns_rdataclass_t rdclass);
|
||||||
/*%<
|
/*%<
|
||||||
|
|
|
||||||
|
|
@ -227,6 +227,9 @@ logfmtpacket(dns_message_t *message, const char *description,
|
||||||
isc_logcategory_t category, isc_logmodule_t module,
|
isc_logcategory_t category, isc_logmodule_t module,
|
||||||
const dns_master_style_t *style, int level, isc_mem_t *mctx);
|
const dns_master_style_t *style, int level, isc_mem_t *mctx);
|
||||||
|
|
||||||
|
static isc_result_t
|
||||||
|
buildopt(dns_message_t *message, dns_rdataset_t **rdatasetp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate a new dns_msgblock_t, and return a pointer to it. If no memory
|
* Allocate a new dns_msgblock_t, and return a pointer to it. If no memory
|
||||||
* is free, return NULL.
|
* is free, return NULL.
|
||||||
|
|
@ -2629,8 +2632,9 @@ dns_message_getopt(dns_message_t *msg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
dns_message_setopt(dns_message_t *msg, dns_rdataset_t *opt) {
|
dns_message_setopt(dns_message_t *msg) {
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
dns_rdataset_t *opt = NULL;
|
||||||
dns_rdata_t rdata = DNS_RDATA_INIT;
|
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -2652,17 +2656,16 @@ dns_message_setopt(dns_message_t *msg, dns_rdataset_t *opt) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
REQUIRE(DNS_MESSAGE_VALID(msg));
|
REQUIRE(DNS_MESSAGE_VALID(msg));
|
||||||
REQUIRE(opt == NULL || DNS_RDATASET_VALID(opt));
|
|
||||||
REQUIRE(opt == NULL || opt->type == dns_rdatatype_opt);
|
|
||||||
REQUIRE(msg->from_to_wire == DNS_MESSAGE_INTENTRENDER);
|
REQUIRE(msg->from_to_wire == DNS_MESSAGE_INTENTRENDER);
|
||||||
REQUIRE(msg->state == DNS_SECTION_ANY);
|
REQUIRE(msg->state == DNS_SECTION_ANY);
|
||||||
|
|
||||||
msgresetopt(msg);
|
result = buildopt(msg, &opt);
|
||||||
|
if (result != ISC_R_SUCCESS) {
|
||||||
if (opt == NULL) {
|
return result;
|
||||||
return ISC_R_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
msgresetopt(msg);
|
||||||
|
|
||||||
result = dns_rdataset_first(opt);
|
result = dns_rdataset_first(opt);
|
||||||
if (result != ISC_R_SUCCESS) {
|
if (result != ISC_R_SUCCESS) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
@ -4897,8 +4900,8 @@ dns_message_ednsaddopt(dns_message_t *msg, dns_ednsopt_t *option) {
|
||||||
return ISC_R_SUCCESS;
|
return ISC_R_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
static isc_result_t
|
||||||
dns_message_buildopt(dns_message_t *message, dns_rdataset_t **rdatasetp) {
|
buildopt(dns_message_t *message, dns_rdataset_t **rdatasetp) {
|
||||||
dns_rdataset_t *rdataset = NULL;
|
dns_rdataset_t *rdataset = NULL;
|
||||||
dns_rdatalist_t *rdatalist = NULL;
|
dns_rdatalist_t *rdatalist = NULL;
|
||||||
dns_rdata_t *rdata = NULL;
|
dns_rdata_t *rdata = NULL;
|
||||||
|
|
|
||||||
|
|
@ -2464,7 +2464,6 @@ resquery_send(resquery_t *query) {
|
||||||
bool tcpkeepalive = false;
|
bool tcpkeepalive = false;
|
||||||
unsigned char cookie[COOKIE_BUFFER_SIZE];
|
unsigned char cookie[COOKIE_BUFFER_SIZE];
|
||||||
uint16_t padding = 0;
|
uint16_t padding = 0;
|
||||||
dns_rdataset_t *rdataset = NULL;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the default UDP size to what was
|
* Set the default UDP size to what was
|
||||||
|
|
@ -2605,13 +2604,7 @@ resquery_send(resquery_t *query) {
|
||||||
dns_message_setpadding(fctx->qmessage, padding);
|
dns_message_setpadding(fctx->qmessage, padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
result = dns_message_buildopt(fctx->qmessage,
|
result = dns_message_setopt(fctx->qmessage);
|
||||||
&rdataset);
|
|
||||||
if (result == ISC_R_SUCCESS) {
|
|
||||||
result = dns_message_setopt(fctx->qmessage,
|
|
||||||
rdataset);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result == ISC_R_SUCCESS) {
|
if (result == ISC_R_SUCCESS) {
|
||||||
if (reqnsid) {
|
if (reqnsid) {
|
||||||
query->options |= DNS_FETCHOPT_WANTNSID;
|
query->options |= DNS_FETCHOPT_WANTNSID;
|
||||||
|
|
|
||||||
|
|
@ -1552,7 +1552,6 @@ static isc_result_t
|
||||||
add_opt(dns_message_t *message, uint16_t udpsize, bool reqnsid,
|
add_opt(dns_message_t *message, uint16_t udpsize, bool reqnsid,
|
||||||
bool reqexpire) {
|
bool reqexpire) {
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
dns_rdataset_t *rdataset = NULL;
|
|
||||||
|
|
||||||
dns_message_ednsinit(message, 0, udpsize, 0, 0);
|
dns_message_ednsinit(message, 0, udpsize, 0, 0);
|
||||||
|
|
||||||
|
|
@ -1572,12 +1571,7 @@ add_opt(dns_message_t *message, uint16_t udpsize, bool reqnsid,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = dns_message_buildopt(message, &rdataset);
|
return dns_message_setopt(message);
|
||||||
if (result != ISC_R_SUCCESS) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dns_message_setopt(message, rdataset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -12862,7 +12862,6 @@ static isc_result_t
|
||||||
add_opt(dns_message_t *message, uint16_t udpsize, bool reqnsid,
|
add_opt(dns_message_t *message, uint16_t udpsize, bool reqnsid,
|
||||||
bool reqexpire) {
|
bool reqexpire) {
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
dns_rdataset_t *rdataset = NULL;
|
|
||||||
|
|
||||||
dns_message_ednsinit(message, 0, udpsize, 0, 0);
|
dns_message_ednsinit(message, 0, udpsize, 0, 0);
|
||||||
|
|
||||||
|
|
@ -12882,12 +12881,7 @@ add_opt(dns_message_t *message, uint16_t udpsize, bool reqnsid,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = dns_message_buildopt(message, &rdataset);
|
return dns_message_setopt(message);
|
||||||
if (result != ISC_R_SUCCESS) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dns_message_setopt(message, rdataset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -266,12 +266,6 @@ ns_client_endrequest(ns_client_t *client) {
|
||||||
#endif /* ifdef ENABLE_AFL */
|
#endif /* ifdef ENABLE_AFL */
|
||||||
dns_view_detach(&client->inner.view);
|
dns_view_detach(&client->inner.view);
|
||||||
}
|
}
|
||||||
if (client->inner.opt != NULL) {
|
|
||||||
INSIST(dns_rdataset_isassociated(client->inner.opt));
|
|
||||||
dns_rdataset_disassociate(client->inner.opt);
|
|
||||||
dns_message_puttemprdataset(client->message,
|
|
||||||
&client->inner.opt);
|
|
||||||
}
|
|
||||||
|
|
||||||
client_zoneversion_reset(client);
|
client_zoneversion_reset(client);
|
||||||
client->inner.signer = NULL;
|
client->inner.signer = NULL;
|
||||||
|
|
@ -616,8 +610,7 @@ ns_client_send(ns_client_t *client) {
|
||||||
* Create an OPT for our reply.
|
* Create an OPT for our reply.
|
||||||
*/
|
*/
|
||||||
if ((client->inner.attributes & NS_CLIENTATTR_WANTOPT) != 0) {
|
if ((client->inner.attributes & NS_CLIENTATTR_WANTOPT) != 0) {
|
||||||
result = ns_client_addopt(client, client->message,
|
result = ns_client_addopt(client, client->message);
|
||||||
&client->inner.opt);
|
|
||||||
if (result != ISC_R_SUCCESS) {
|
if (result != ISC_R_SUCCESS) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
@ -653,14 +646,6 @@ ns_client_send(ns_client_t *client) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client->inner.opt != NULL) {
|
|
||||||
result = dns_message_setopt(client->message, client->inner.opt);
|
|
||||||
opt_included = true;
|
|
||||||
client->inner.opt = NULL;
|
|
||||||
if (result != ISC_R_SUCCESS) {
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result = dns_message_rendersection(client->message,
|
result = dns_message_rendersection(client->message,
|
||||||
DNS_SECTION_QUESTION, 0);
|
DNS_SECTION_QUESTION, 0);
|
||||||
if (result == ISC_R_NOSPACE) {
|
if (result == ISC_R_NOSPACE) {
|
||||||
|
|
@ -1053,8 +1038,7 @@ ns_client_error(ns_client_t *client, isc_result_t result) {
|
||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
ns_client_addopt(ns_client_t *client, dns_message_t *message,
|
ns_client_addopt(ns_client_t *client, dns_message_t *message) {
|
||||||
dns_rdataset_t **opt) {
|
|
||||||
unsigned char ecs[ECS_SIZE];
|
unsigned char ecs[ECS_SIZE];
|
||||||
unsigned char cookie[COOKIE_SIZE];
|
unsigned char cookie[COOKIE_SIZE];
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
|
@ -1066,7 +1050,6 @@ ns_client_addopt(ns_client_t *client, dns_message_t *message,
|
||||||
dns_aclenv_t *env = NULL;
|
dns_aclenv_t *env = NULL;
|
||||||
|
|
||||||
REQUIRE(NS_CLIENT_VALID(client));
|
REQUIRE(NS_CLIENT_VALID(client));
|
||||||
REQUIRE(opt != NULL && *opt == NULL);
|
|
||||||
REQUIRE(message != NULL);
|
REQUIRE(message != NULL);
|
||||||
|
|
||||||
env = client->manager->aclenv;
|
env = client->manager->aclenv;
|
||||||
|
|
@ -1282,7 +1265,7 @@ ns_client_addopt(ns_client_t *client, dns_message_t *message,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = dns_message_buildopt(message, opt);
|
result = dns_message_setopt(message);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1723,11 +1706,8 @@ process_opt(ns_client_t *client, dns_rdataset_t *opt) {
|
||||||
if (client->inner.ednsversion > DNS_EDNS_VERSION) {
|
if (client->inner.ednsversion > DNS_EDNS_VERSION) {
|
||||||
ns_stats_increment(client->manager->sctx->nsstats,
|
ns_stats_increment(client->manager->sctx->nsstats,
|
||||||
ns_statscounter_badednsver);
|
ns_statscounter_badednsver);
|
||||||
result = ns_client_addopt(client, client->message,
|
result = DNS_R_BADVERS;
|
||||||
&client->inner.opt);
|
client->inner.attributes |= NS_CLIENTATTR_WANTOPT;
|
||||||
if (result == ISC_R_SUCCESS) {
|
|
||||||
result = DNS_R_BADVERS;
|
|
||||||
}
|
|
||||||
ns_client_error(client, result);
|
ns_client_error(client, result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -1739,13 +1719,10 @@ process_opt(ns_client_t *client, dns_rdataset_t *opt) {
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
formerr:
|
formerr:
|
||||||
if (result == DNS_R_FORMERR || result == DNS_R_OPTERR) {
|
if (result == DNS_R_OPTERR) {
|
||||||
result = ns_client_addopt(client, client->message,
|
result = DNS_R_FORMERR;
|
||||||
&client->inner.opt);
|
|
||||||
if (result == ISC_R_SUCCESS) {
|
|
||||||
result = DNS_R_FORMERR;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
client->inner.attributes |= NS_CLIENTATTR_WANTOPT;
|
||||||
ns_client_error(client, result);
|
ns_client_error(client, result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -1816,13 +1793,6 @@ ns__client_put_cb(void *client0) {
|
||||||
|
|
||||||
client->magic = 0;
|
client->magic = 0;
|
||||||
|
|
||||||
if (client->inner.opt != NULL) {
|
|
||||||
INSIST(dns_rdataset_isassociated(client->inner.opt));
|
|
||||||
dns_rdataset_disassociate(client->inner.opt);
|
|
||||||
dns_message_puttemprdataset(client->message,
|
|
||||||
&client->inner.opt);
|
|
||||||
}
|
|
||||||
|
|
||||||
ns_client_async_reset(client);
|
ns_client_async_reset(client);
|
||||||
|
|
||||||
dns_message_detach(&client->message);
|
dns_message_detach(&client->message);
|
||||||
|
|
@ -2060,10 +2030,8 @@ ns_client_request(isc_nmhandle_t *handle, isc_result_t eresult,
|
||||||
* (typically FORMERR or SERVFAIL).
|
* (typically FORMERR or SERVFAIL).
|
||||||
*/
|
*/
|
||||||
if (result == DNS_R_OPTERR) {
|
if (result == DNS_R_OPTERR) {
|
||||||
(void)ns_client_addopt(client, client->message,
|
client->inner.attributes |= NS_CLIENTATTR_WANTOPT;
|
||||||
&client->inner.opt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
|
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
|
||||||
NS_LOGMODULE_CLIENT, ISC_LOG_DEBUG(1),
|
NS_LOGMODULE_CLIENT, ISC_LOG_DEBUG(1),
|
||||||
"message parsing failed: %s",
|
"message parsing failed: %s",
|
||||||
|
|
|
||||||
|
|
@ -177,13 +177,12 @@ struct ns_client {
|
||||||
isc_nmhandle_t *updatehandle; /* Waiting for update callback */
|
isc_nmhandle_t *updatehandle; /* Waiting for update callback */
|
||||||
isc_nmhandle_t *restarthandle; /* Waiting for restart callback
|
isc_nmhandle_t *restarthandle; /* Waiting for restart callback
|
||||||
*/
|
*/
|
||||||
unsigned char *tcpbuf;
|
unsigned char *tcpbuf;
|
||||||
size_t tcpbuf_size;
|
size_t tcpbuf_size;
|
||||||
dns_rdataset_t *opt;
|
uint16_t udpsize;
|
||||||
uint16_t udpsize;
|
uint16_t extflags;
|
||||||
uint16_t extflags;
|
int16_t ednsversion; /* -1 noedns */
|
||||||
int16_t ednsversion; /* -1 noedns */
|
uint16_t additionaldepth;
|
||||||
uint16_t additionaldepth;
|
|
||||||
void (*cleanup)(ns_client_t *);
|
void (*cleanup)(ns_client_t *);
|
||||||
isc_time_t requesttime;
|
isc_time_t requesttime;
|
||||||
isc_stdtime_t now;
|
isc_stdtime_t now;
|
||||||
|
|
@ -455,8 +454,7 @@ isc_result_t
|
||||||
ns_client_sourceip(dns_clientinfo_t *ci, isc_sockaddr_t **addrp);
|
ns_client_sourceip(dns_clientinfo_t *ci, isc_sockaddr_t **addrp);
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
ns_client_addopt(ns_client_t *client, dns_message_t *message,
|
ns_client_addopt(ns_client_t *client, dns_message_t *message);
|
||||||
dns_rdataset_t **opt);
|
|
||||||
|
|
||||||
/*%<
|
/*%<
|
||||||
* Get a client object from the inactive queue, or create one, as needed.
|
* Get a client object from the inactive queue, or create one, as needed.
|
||||||
|
|
|
||||||
|
|
@ -1413,10 +1413,7 @@ sendstream(xfrout_ctx_t *xfr) {
|
||||||
if ((xfr->client->inner.attributes & NS_CLIENTATTR_WANTOPT) !=
|
if ((xfr->client->inner.attributes & NS_CLIENTATTR_WANTOPT) !=
|
||||||
0)
|
0)
|
||||||
{
|
{
|
||||||
dns_rdataset_t *opt = NULL;
|
CHECK(ns_client_addopt(xfr->client, msg));
|
||||||
|
|
||||||
CHECK(ns_client_addopt(xfr->client, msg, &opt));
|
|
||||||
CHECK(dns_message_setopt(msg, opt));
|
|
||||||
/*
|
/*
|
||||||
* Add to first message only.
|
* Add to first message only.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue