Commit 6e49e91b authored by David Lawrence's avatar David Lawrence
Browse files

103. [func] libisc buffer API changes for <isc/buffer.h>:

                        Added:
                                isc_buffer_base(b)          (pointer)
                                isc_buffer_current(b)       (pointer)
                                isc_buffer_active(b)        (pointer)
                                isc_buffer_used(b)          (pointer)
                                isc_buffer_length(b)            (int)
                                isc_buffer_usedlength(b)        (int)
                                isc_buffer_consumedlength(b)    (int)
                                isc_buffer_remaininglength(b)   (int)
                                isc_buffer_activelength(b)      (int)
                                isc_buffer_availablelength(b)   (int)
                        Removed:
                                ISC_BUFFER_USEDCOUNT(b)
                                ISC_BUFFER_AVAILABLECOUNT(b)
                                isc_buffer_type(b)
                        Changed names:
                                isc_buffer_used(b, r) ->
                                        isc_buffer_usedregion(b, r)
                                isc_buffer_available(b, r) ->
                                        isc_buffer_available_region(b, r)
                                isc_buffer_consumed(b, r) ->
                                        isc_buffer_consumedregion(b, r)
                                isc_buffer_active(b, r) ->
                                        isc_buffer_activeregion(b, r)
                                isc_buffer_remaining(b, r) ->
                                        isc_buffer_remainingregion(b, r)

                        Buffer types were removed, so the ISC_BUFFERTYPE_*
                        macros are no more, and the type argument to
                        isc_buffer_init and isc_buffer_allocate were removed.
                        isc_buffer_putstr is now void (instead of isc_result_t)
                        and requires that the caller ensure that there
                        is enough available buffer space for the string.
parent ace0c1b3
102. [bug] Correctly detect inet_aton, inet_pton and inet_ptop
103. [func] libisc buffer API changes for <isc/buffer.h>:
Added:
isc_buffer_base(b) (pointer)
isc_buffer_current(b) (pointer)
isc_buffer_active(b) (pointer)
isc_buffer_used(b) (pointer)
isc_buffer_length(b) (int)
isc_buffer_usedlength(b) (int)
isc_buffer_consumedlength(b) (int)
isc_buffer_remaininglength(b) (int)
isc_buffer_activelength(b) (int)
isc_buffer_availablelength(b) (int)
Removed:
ISC_BUFFER_USEDCOUNT(b)
ISC_BUFFER_AVAILABLECOUNT(b)
isc_buffer_type(b)
Changed names:
isc_buffer_used(b, r) ->
isc_buffer_usedregion(b, r)
isc_buffer_available(b, r) ->
isc_buffer_available_region(b, r)
isc_buffer_consumed(b, r) ->
isc_buffer_consumedregion(b, r)
isc_buffer_active(b, r) ->
isc_buffer_activeregion(b, r)
isc_buffer_remaining(b, r) ->
isc_buffer_remainingregion(b, r)
Buffer types were removed, so the ISC_BUFFERTYPE_*
macros are no more, and the type argument to
isc_buffer_init and isc_buffer_allocate were removed.
isc_buffer_putstr is now void (instead of isc_result_t)
and requires that the caller ensure that there
is enough available buffer space for the string.
102. [port] Correctly detect inet_aton, inet_pton and inet_ptop
on BSD/OS 4.1.
101. [cleanup] Quieted EGCS warnings from lib/isc/print.c.
......
......@@ -59,9 +59,7 @@ extern int h_errno;
extern ISC_LIST(dig_lookup_t) lookup_list;
extern ISC_LIST(dig_server_t) server_list;
extern isc_boolean_t tcp_mode,
recurse,
have_ipv6;
extern isc_boolean_t tcp_mode, recurse, have_ipv6;
extern in_port_t port;
extern unsigned int timeout;
extern isc_mem_t *mctx;
......@@ -118,7 +116,7 @@ static char *rcodetext[] = {
static void
show_usage() {
fatal ("Usage.");
fatal("Usage.");
}
void
......@@ -128,14 +126,14 @@ check_next_lookup(dig_lookup_t *lookup) {
isc_boolean_t still_working=ISC_FALSE;
#ifdef DEBUG
fputs ("In check_next_lookup",stderr);
fputs("In check_next_lookup",stderr);
#endif
for (query = ISC_LIST_HEAD(lookup->q);
query != NULL;
query = ISC_LIST_NEXT(query, link)) {
if (query->working) {
#ifdef DEBUG
fputs ("Still have a worker.",stderr);
fputs("Still have a worker.",stderr);
#endif
still_working=ISC_TRUE;
}
......@@ -143,10 +141,10 @@ check_next_lookup(dig_lookup_t *lookup) {
if (still_working)
return;
next = ISC_LIST_NEXT (lookup, link);
next = ISC_LIST_NEXT(lookup, link);
if (next == NULL) {
#ifdef DEBUG
fputs ("Shutting Down.",stderr);
fputs("Shutting Down.",stderr);
#endif
isc_app_shutdown();
return;
......@@ -196,7 +194,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid, char *section_name,
name = NULL;
dns_message_currentname(msg, sectionid, &name);
isc_buffer_init(&target, t, sizeof t, ISC_BUFFERTYPE_TEXT);
isc_buffer_init(&target, t, sizeof(t));
first = ISC_TRUE;
print_name = name;
......@@ -217,7 +215,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid, char *section_name,
}
#endif
}
isc_buffer_used(&target, &r);
isc_buffer_usedregion(&target, &r);
if (no_rdata)
printf(";%.*s", (int)r.length, (char *)r.base);
else
......@@ -246,13 +244,13 @@ printrdata(dns_message_t *msg, dns_rdataset_t *rdataset, dns_name_t *owner,
if (headers)
printf(";; %s SECTION:\n", set_name);
isc_buffer_init(&target, t, sizeof t, ISC_BUFFERTYPE_TEXT);
isc_buffer_init(&target, t, sizeof(t));
result = dns_rdataset_totext(rdataset, owner, ISC_FALSE, ISC_FALSE,
&target);
if (result != ISC_R_SUCCESS)
return (result);
isc_buffer_used(&target, &r);
isc_buffer_usedregion(&target, &r);
printf("%.*s", (int)r.length, (char *)r.base);
return (ISC_R_SUCCESS);
......@@ -262,7 +260,7 @@ isc_result_t
printmessage(dns_message_t *msg, isc_boolean_t headers) {
isc_boolean_t did_flag = ISC_FALSE;
isc_result_t result;
dns_rdataset_t *opt, *tsig;
dns_rdataset_t *opt, *tsig = NULL;
dns_name_t *tsigname;
result = ISC_R_SUCCESS;
......@@ -300,7 +298,8 @@ printmessage(dns_message_t *msg, isc_boolean_t headers) {
printf("%scd", did_flag ? " " : "");
did_flag = ISC_TRUE;
}
printf("; QUERY: %u, ANSWER: %u, AUTHORITY: %u, ADDITIONAL: %u\n",
printf("; QUERY: %u, ANSWER: %u, "
"AUTHORITY: %u, ADDITIONAL: %u\n",
msg->counts[DNS_SECTION_QUESTION],
msg->counts[DNS_SECTION_ANSWER],
msg->counts[DNS_SECTION_AUTHORITY],
......@@ -367,15 +366,14 @@ printmessage(dns_message_t *msg, isc_boolean_t headers) {
*/
void
parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
isc_boolean_t have_host=ISC_FALSE;
dig_server_t *srv=NULL;
dig_lookup_t *lookup=NULL;
char *batchname=NULL;
isc_boolean_t have_host = ISC_FALSE;
dig_server_t *srv = NULL;
dig_lookup_t *lookup = NULL;
char *batchname = NULL;
char batchline[MXNAME];
FILE *fp=NULL;
FILE *fp = NULL;
int bargc;
char *bargv[8];
char *ptr;
int i,n;
int adrs[4];
......@@ -384,7 +382,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
&& (!is_batchfile)) {
srv=isc_mem_allocate(mctx, sizeof(struct dig_server));
if (srv == NULL)
fatal ("Memory allocation failure.");
fatal("Memory allocation failure.");
strncpy(srv->servername,&argv[0][1],MXNAME-1);
ISC_LIST_APPEND(server_list, srv, link);
} else if ((strcmp(argv[0],"+vc") == 0)
......@@ -413,27 +411,27 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
argc--;
}
} else if (strncmp(argv[0],"-x",2) == 0) {
n = sscanf (argv[1],"%d.%d.%d.%d", &adrs[0], &adrs[1],
n = sscanf(argv[1],"%d.%d.%d.%d", &adrs[0], &adrs[1],
&adrs[2], &adrs[3]);
if (n == 0)
show_usage();
lookup = isc_mem_allocate (mctx,
sizeof(struct dig_lookup));
lookup = isc_mem_allocate(mctx,
sizeof(struct dig_lookup));
if (lookup == NULL)
fatal ("Memory allocation failure.");
fatal("Memory allocation failure.");
lookup->pending = ISC_FALSE;
lookup->textname[0]=0;
for (i=n-1; i>=0; i--) {
snprintf (batchline, MXNAME/8, "%d.",
for (i = n - 1; i >= 0; i--) {
snprintf(batchline, MXNAME/8, "%d.",
adrs[i]);
strncat (lookup->textname, batchline, MXNAME);
strncat(lookup->textname, batchline, MXNAME);
}
strncat (lookup->textname, "in-addr.arpa.", MXNAME);
strncat(lookup->textname, "in-addr.arpa.", MXNAME);
#ifdef DEBUG
fprintf (stderr,"Looking up %s\n",lookup->textname);
fprintf(stderr,"Looking up %s\n",lookup->textname);
#endif
strcpy (lookup->rttext, "ptr");
strcpy (lookup->rctext, "in");
strcpy(lookup->rttext, "ptr");
strcpy(lookup->rctext, "in");
lookup->namespace[0]=0;
lookup->sendspace[0]=0;
lookup->sendmsg=NULL;
......@@ -448,23 +446,22 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
argc--;
} else {
if (have_host) {
ENSURE ( lookup != NULL );
ENSURE(lookup != NULL);
if (isclass(argv[0])) {
strncpy (lookup->rctext,argv[0],
strncpy(lookup->rctext,argv[0],
MXRD);
continue;
} else if (istype(argv[0])) {
strncpy (lookup->rttext,argv[0],
MXRD);
strncpy(lookup->rttext,argv[0], MXRD);
continue;
}
}
lookup = isc_mem_allocate (mctx,
sizeof(struct dig_lookup));
lookup = isc_mem_allocate(mctx,
sizeof(struct dig_lookup));
if (lookup == NULL)
fatal ("Memory allocation failure.");
fatal("Memory allocation failure.");
lookup->pending = ISC_FALSE;
strncpy (lookup->textname,argv[0], MXNAME-1);
strncpy(lookup->textname,argv[0], MXNAME-1);
lookup->rttext[0]=0;
lookup->rctext[0]=0;
lookup->namespace[0]=0;
......@@ -478,17 +475,17 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
ISC_LIST_APPEND(lookup_list, lookup, link);
have_host = ISC_TRUE;
#ifdef DEBUG
fprintf (stderr,"Looking up %s\n",lookup->textname);
fprintf(stderr, "Looking up %s\n", lookup->textname);
#endif
}
}
if (batchname != NULL) {
fp = fopen (batchname, "r");
fp = fopen(batchname, "r");
if (fp == NULL) {
perror (batchname);
fatal ("Couldn't open specified batch file.");
perror(batchname);
fatal("Couldn't open specified batch file.");
}
while (fgets (batchline, MXNAME, fp) != 0) {
while (fgets(batchline, MXNAME, fp) != 0) {
bargc=1;
bargv[bargc]=strtok(batchline, " \t");
while (bargv[bargc] != NULL) {
......@@ -498,16 +495,15 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
bargc--;
bargv[0]="dig";
#ifdef DEBUG
fprintf (stderr,"Parsing %d:%s\n",bargc,bargv[1]);
fprintf(stderr,"Parsing %d:%s\n",bargc,bargv[1]);
#endif
parse_args(ISC_TRUE, bargc, (char**)bargv);
}
}
if (lookup_list.head == NULL) {
lookup = isc_mem_allocate (mctx,
sizeof(struct dig_lookup));
lookup = isc_mem_allocate(mctx, sizeof(struct dig_lookup));
if (lookup == NULL)
fatal ("Memory allocation failure.");
fatal("Memory allocation failure.");
lookup->pending = ISC_FALSE;
lookup->rctext[0]=0;
lookup->namespace[0]=0;
......@@ -518,10 +514,9 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
lookup->xfr_q = NULL;
lookup->doing_xfr = ISC_FALSE;
ISC_LIST_INIT(lookup->q);
strcpy (lookup->textname,".");
strcpy (lookup->rttext, "NS");
strcpy(lookup->textname,".");
strcpy(lookup->rttext, "NS");
lookup->rctext[0]=0;
ISC_LIST_APPEND(lookup_list, lookup, link);
}
}
......@@ -61,21 +61,19 @@ extern int h_errno;
ISC_LIST(dig_lookup_t) lookup_list;
ISC_LIST(dig_server_t) server_list;
isc_boolean_t tcp_mode=ISC_FALSE,
recurse=ISC_TRUE,
have_ipv6=ISC_FALSE;
isc_boolean_t tcp_mode = ISC_FALSE, recurse = ISC_TRUE, have_ipv6 = ISC_FALSE;
in_port_t port;
unsigned int timeout;
isc_mem_t *mctx=NULL;
isc_taskmgr_t *taskmgr=NULL;
isc_task_t *task=NULL;
isc_timermgr_t *timermgr=NULL;
isc_socketmgr_t *socketmgr=NULL;
isc_mem_t *mctx = NULL;
isc_taskmgr_t *taskmgr = NULL;
isc_task_t *task = NULL;
isc_timermgr_t *timermgr = NULL;
isc_socketmgr_t *socketmgr = NULL;
dns_messageid_t id;
dns_name_t rootorg;
char *rootspace[BUFSIZE];
isc_buffer_t rootbuf;
int sendcount=0;
int sendcount = 0;
extern isc_boolean_t short_form;
......@@ -87,9 +85,9 @@ hex_dump(isc_buffer_t *b) {
unsigned int len;
isc_region_t r;
isc_buffer_remaining(b, &r);
isc_buffer_remainingregion(b, &r);
printf ("Printing a buffer with length %d\n",r.length);
printf("Printing a buffer with length %d\n", r.length);
for (len = 0 ; len < r.length ; len++) {
printf("%02x ", r.base[len]);
if (len != 0 && len % 16 == 0)
......@@ -110,9 +108,9 @@ fatal(char *format, ...) {
fprintf(stderr, "\n");
free_lists();
isc_app_finish();
if (mctx != NULL) {
isc_mem_destroy (&mctx);
}
if (mctx != NULL)
isc_mem_destroy(&mctx);
exit(1);
}
......@@ -131,10 +129,10 @@ isclass(char *text) {
const int numclasses = 3;
int i;
for (i=0;i<numclasses;i++) {
for (i = 0; i < numclasses; i++)
if (strcasecmp(text, classlist[i]) == 0)
return ISC_TRUE;
}
return ISC_FALSE;
}
......@@ -144,19 +142,19 @@ istype(char *text) {
initialized. This list will have to be manually kept in
sync with what the libs support. */
const char *typelist[] = {"a", "ns", "md", "mf", "cname",
"soa", "mb", "mg", "mr", "null",
"wks", "ptr", "hinfo", "minfo",
"mx", "txt", "rp", "afsdb",
"x25", "isdn", "rt", "nsap",
"nsap_ptr", "sig", "key", "px",
"gpos", "aaaa", "loc", "nxt",
"srv", "naptr", "kx", "cert",
"a6", "dname", "opt", "unspec",
"tkey", "tsig", "axfr"};
"soa", "mb", "mg", "mr", "null",
"wks", "ptr", "hinfo", "minfo",
"mx", "txt", "rp", "afsdb",
"x25", "isdn", "rt", "nsap",
"nsap_ptr", "sig", "key", "px",
"gpos", "aaaa", "loc", "nxt",
"srv", "naptr", "kx", "cert",
"a6", "dname", "opt", "unspec",
"tkey", "tsig", "axfr"};
const int numtypes = 41;
int i;
for (i=0;i<numtypes;i++) {
for (i = 0; i < numtypes; i++) {
if (strcasecmp(text, typelist[i]) == 0)
return ISC_TRUE;
}
......@@ -165,95 +163,88 @@ istype(char *text) {
static void
setup_system() {
setup_system(void) {
char rcinput[MXNAME];
FILE *fp;
char *ptr;
dig_server_t *srv;
id = getpid()<<8;
id = getpid() << 8;
if (server_list.head == NULL) {
fp = fopen (RESOLVCONF, "r");
if (fp != NULL) {
while (fgets(rcinput, MXNAME, fp) != 0) {
ptr = strtok (rcinput, " \t");
if (ptr != NULL) {
if (strcasecmp(ptr,"nameserver")
== 0) {
ptr = strtok (NULL, " \t");
if (ptr != NULL) {
srv=isc_mem_allocate
(mctx,
sizeof
(struct
dig_server));
if (srv == NULL)
fatal
("Memory allocation failure.");
if (ptr != NULL &&
strcasecmp(ptr, "nameserver") == 0) {
ptr = strtok (NULL, " \t");
if (ptr != NULL) {
srv = isc_mem_allocate(mctx,
sizeof(struct dig_server));
if (srv == NULL)
fatal("Memory "
"allocation "
"failure.");
strncpy(srv->
servername,
ptr,MXNAME-1);
ptr,
MXNAME - 1);
ISC_LIST_APPEND
(server_list,
srv, link);
}
}
}
}
fclose (fp);
}
}
if (server_list.head == NULL) {
srv = isc_mem_allocate(mctx, sizeof(dig_server_t));
if (srv == NULL)
fatal ("Memory allocation failure");
strcpy (srv->servername, "127.0.0.1");
fatal("Memory allocation failure");
strcpy(srv->servername, "127.0.0.1");
ISC_LIST_APPEND(server_list, srv, link);
}
}
static void
setup_libs() {
setup_libs(void) {
isc_result_t result;
isc_buffer_t b;
result = isc_app_start();
check_result (result, "isc_app_start");
check_result(result, "isc_app_start");
result = isc_net_probeipv4();
check_result (result, "isc_net_probeipv4");
check_result(result, "isc_net_probeipv4");
result = isc_net_probeipv6();
if (result == ISC_R_SUCCESS)
have_ipv6=ISC_TRUE;
result = isc_mem_create (0, 0, &mctx);
check_result (result, "isc_mem_create");
result = isc_mem_create(0, 0, &mctx);
check_result(result, "isc_mem_create");
result = isc_taskmgr_create (mctx, 1, 0, &taskmgr);
check_result (result, "isc_taskmgr_create");
check_result(result, "isc_taskmgr_create");
result = isc_task_create (taskmgr, 0, &task);
check_result (result, "isc_task_create");
check_result(result, "isc_task_create");
result = isc_timermgr_create (mctx, &timermgr);
check_result (result, "isc_timermgr_create");
check_result(result, "isc_timermgr_create");
result = isc_socketmgr_create (mctx, &socketmgr);
check_result (result, "isc_socketmgr_create");
isc_buffer_init (&b, ".", 1, ISC_BUFFERTYPE_TEXT);
isc_buffer_add (&b, 1);
dns_name_init (&rootorg, NULL);
isc_buffer_init (&rootbuf, rootspace, BUFSIZE,
ISC_BUFFERTYPE_BINARY);
result = dns_name_fromtext (&rootorg, &b, NULL,
ISC_FALSE, &rootbuf);
check_result (result, "dns_name_fromtext");
check_result(result, "isc_socketmgr_create");
isc_buffer_init(&b, ".", 1);
isc_buffer_add(&b, 1);
dns_name_init(&rootorg, NULL);
isc_buffer_init(&rootbuf, rootspace, BUFSIZE);
result = dns_name_fromtext(&rootorg, &b, NULL, ISC_FALSE, &rootbuf);
check_result(result, "dns_name_fromtext");
}
static void
......@@ -283,37 +274,35 @@ setup_lookup(dig_lookup_t *lookup) {
isc_buffer_t b;
#ifdef DEBUG
fprintf (stderr,"Setting up for looking up %s\n",lookup->textname);
fprintf(stderr, "Setting up for looking up %s\n", lookup->textname);
#endif
len=strlen(lookup->textname);
isc_buffer_init (&b, lookup->textname, len,
ISC_BUFFERTYPE_TEXT);
isc_buffer_add (&b, len);
isc_buffer_init(&b, lookup->textname, len);
isc_buffer_add(&b, len);
result = dns_message_create(mctx, DNS_MESSAGE_INTENTRENDER,
&lookup->sendmsg);
check_result (result, "dns_message_create");
check_result(result, "dns_message_create");
result = dns_message_gettempname(lookup->sendmsg, &lookup->name);
check_result (result,"dns_message_gettempname");
dns_name_init (lookup->name, NULL);
check_result(result, "dns_message_gettempname");
dns_name_init(lookup->name, NULL);
isc_buffer_init (&lookup->namebuf, lookup->namespace, BUFSIZE,
ISC_BUFFERTYPE_BINARY);
isc_buffer_init(&lookup->namebuf, lookup->namespace, BUFSIZE);
result = dns_name_fromtext (lookup->name, &b, &rootorg,
result = dns_name_fromtext(lookup->name, &b, &rootorg,
ISC_FALSE, &lookup->namebuf);
if (result != ISC_R_SUCCESS) {
dns_message_puttempname (lookup->sendmsg, &lookup->name);
fatal ("Aborting: %s is not a legal name syntax.",
lookup->textname);
dns_message_puttempname(lookup->sendmsg, &lookup->name);
fatal("Aborting: %s is not a legal name syntax.",
lookup->textname);
}
if (lookup->rctext[0] == 0)
strcpy (lookup->rctext, "IN");
strcpy(lookup->rctext, "IN");
if (lookup->rttext[0] == 0)
strcpy (lookup->rttext, "A");
strcpy(lookup->rttext, "A");
lookup->sendmsg->id = id++;
lookup->sendmsg->opcode = dns_opcode_query;
......@@ -327,27 +316,28 @@ setup_lookup(dig_lookup_t *lookup) {
r.base=lookup->rttext;
r.length=strlen(lookup->rttext);
result = dns_rdatatype_fromtext(&rdtype, &r);
check_result (result, "dns_rdatatype_fromtext");
if (rdtype == dns_rdatatype_axfr) {
check_result(result, "dns_rdatatype_fromtext");
if (rdtype == dns_rdatatype_axfr) {
lookup->doing_xfr = ISC_TRUE;
/* Force TCP mode if we're doing an xfr */
/*
* Force TCP mode if we're doing an xfr.
*/
tcp_mode = ISC_TRUE;
}
r.base=lookup->rctext;
r.length=strlen(lookup->rctext);
result = dns_rdataclass_fromtext(&rdclass, &r);
check_result (result, "dns_rdataclass_fromtext");
check_result(result, "dns_rdataclass_fromtext");
add_type(lookup->sendmsg, lookup->name, rdclass, rdtype);
isc_buffer_init (&lookup->sendbuf, lookup->sendspace, COMMSIZE,
ISC_BUFFERTYPE_BINARY);
isc_buffer_init(&lookup->sendbuf, lookup->sendspace, COMMSIZE);
result = dns_message_renderbegin(lookup->sendmsg, &lookup->sendbuf);
check_result (result, "dns_message_renderbegin");
check_result(result, "dns_message_renderbegin");
result = dns_message_rendersection(lookup->sendmsg,
DNS_SECTION_QUESTION,0);
check_result (result, "dns_message_rendersection");
DNS_SECTION_QUESTION, 0);
check_result(result, "dns_message_rendersection");
result = dns_message_renderend(lookup->sendmsg);
check_result (result, "dns_message_renderend");
check_result(result, "dns_message_renderend");
lookup->pending = ISC_FALSE;
......@@ -356,33 +346,30 @@ setup_lookup(dig_lookup_t *lookup) {
serv = ISC_LIST_NEXT(serv, link)) {
query = isc_mem_allocate(mctx, sizeof(dig_query_t));
if (query == NULL)
fatal ("Memory allocation failure.");
fatal("Memory allocation failure.");
query->lookup = lookup;
query->working = ISC_FALSE;