define DNS_OPT_EDNSOPTIONS

(cherry picked from commit 72ba6ba736)
This commit is contained in:
Mark Andrews 2014-02-20 13:55:21 +11:00
parent f74c892d50
commit 375dac22e4
3 changed files with 7 additions and 4 deletions

View file

@ -1263,7 +1263,7 @@ client_addopt(ns_client_t *client) {
dns_view_t *view;
dns_resolver_t *resolver;
isc_uint16_t udpsize;
dns_ednsopt_t ednsopts[2];
dns_ednsopt_t ednsopts[DNS_OPT_EDNSOPTIONS];
int count = 0;
unsigned int flags;
@ -1292,6 +1292,7 @@ client_addopt(ns_client_t *client) {
} else
nsidp = ns_g_server->server_id;
INSIST(count < DNS_OPT_EDNSOPTIONS);
ednsopts[count].code = DNS_OPT_NSID;
ednsopts[count].length = strlen(nsidp);
ednsopts[count].value = (unsigned char *)nsidp;

View file

@ -107,6 +107,9 @@
#define DNS_OPT_NSID 0x0003 /*%< NSID opt code */
#define DNS_OPT_CLIENT_SUBNET 0x0008 /*%< client subnet opt code */
/*%< The number of EDNS options we know about. */
#define DNS_OPT_EDNSOPTIONS 3
#define DNS_MESSAGE_REPLYPRESERVE (DNS_MESSAGEFLAG_RD|DNS_MESSAGEFLAG_CD)
#define DNS_MESSAGEEXTFLAG_REPLYPRESERVE (DNS_MESSAGEEXTFLAG_DO)

View file

@ -135,7 +135,6 @@
* Maximum EDNS0 input packet size.
*/
#define RECV_BUFFER_SIZE 4096 /* XXXRTH Constant. */
#define EDNSOPTS 2
/*%
* This defines the maximum number of timeouts we will permit before we
@ -1675,7 +1674,7 @@ resquery_send(resquery_t *query) {
isc_boolean_t cleanup_cctx = ISC_FALSE;
isc_boolean_t secure_domain;
isc_boolean_t connecting = ISC_FALSE;
dns_ednsopt_t ednsopts[EDNSOPTS];
dns_ednsopt_t ednsopts[DNS_OPT_EDNSOPTIONS];
unsigned ednsopt = 0;
fctx = query->fctx;
@ -1860,7 +1859,7 @@ resquery_send(resquery_t *query) {
if (peer != NULL)
(void) dns_peer_getrequestnsid(peer, &reqnsid);
if (reqnsid) {
INSIST(ednsopt < EDNSOPTS);
INSIST(ednsopt < DNS_OPT_EDNSOPTIONS);
ednsopts[ednsopt].code = DNS_OPT_NSID;
ednsopts[ednsopt].length = 0;
ednsopts[ednsopt].value = NULL;