Merge commit '281819e5f8b19cd8627541a22d261906fd190276' into merges
[unleashed.git] / usr / src / lib / libresolv2 / common / resolv / res_findzonecut.c
blob3573891007d794a386d96f49c541ea37831e19a5
1 /*
2 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (c) 1999 by Internet Software Consortium.
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
15 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 /* Import. */
20 #include "port_before.h"
22 #include <sys/param.h>
23 #include <sys/socket.h>
24 #include <sys/time.h>
26 #include <netinet/in.h>
27 #include <arpa/inet.h>
28 #include <arpa/nameser.h>
30 #include <errno.h>
31 #include <limits.h>
32 #include <netdb.h>
33 #include <stdarg.h>
34 #include <stdio.h>
35 #include <stdlib.h>
36 #include <string.h>
38 #include <isc/list.h>
40 #include "port_after.h"
42 #include <resolv.h>
44 /* Data structures. */
46 typedef struct rr_a {
47 LINK(struct rr_a) link;
48 union res_sockaddr_union addr;
49 } rr_a;
50 typedef LIST(rr_a) rrset_a;
52 typedef struct rr_ns {
53 LINK(struct rr_ns) link;
54 const char * name;
55 unsigned int flags;
56 rrset_a addrs;
57 } rr_ns;
58 typedef LIST(rr_ns) rrset_ns;
60 #define RR_NS_HAVE_V4 0x01
61 #define RR_NS_HAVE_V6 0x02
63 /* Forward. */
65 static int satisfy(res_state, const char *, rrset_ns *,
66 union res_sockaddr_union *, int);
67 static int add_addrs(res_state, rr_ns *,
68 union res_sockaddr_union *, int);
69 static int get_soa(res_state, const char *, ns_class, int,
70 char *, size_t, char *, size_t,
71 rrset_ns *);
72 static int get_ns(res_state, const char *, ns_class, int, rrset_ns *);
73 static int get_glue(res_state, ns_class, int, rrset_ns *);
74 static int save_ns(res_state, ns_msg *, ns_sect,
75 const char *, ns_class, int, rrset_ns *);
76 static int save_a(res_state, ns_msg *, ns_sect,
77 const char *, ns_class, int, rr_ns *);
78 static void free_nsrrset(rrset_ns *);
79 static void free_nsrr(rrset_ns *, rr_ns *);
80 static rr_ns * find_ns(rrset_ns *, const char *);
81 static int do_query(res_state, const char *, ns_class, ns_type,
82 u_char *, ns_msg *);
83 static void res_dprintf(const char *, ...) ISC_FORMAT_PRINTF(1, 2);
85 /* Macros. */
87 #define DPRINTF(x) do {\
88 int save_errno = errno; \
89 if ((statp->options & RES_DEBUG) != 0U) res_dprintf x; \
90 errno = save_errno; \
91 } while (0)
93 /* Public. */
95 /*%
96 * find enclosing zone for a <dname,class>, and some server addresses
98 * parameters:
99 *\li res - resolver context to work within (is modified)
100 *\li dname - domain name whose enclosing zone is desired
101 *\li class - class of dname (and its enclosing zone)
102 *\li zname - found zone name
103 *\li zsize - allocated size of zname
104 *\li addrs - found server addresses
105 *\li naddrs - max number of addrs
107 * return values:
108 *\li < 0 - an error occurred (check errno)
109 *\li = 0 - zname is now valid, but addrs[] wasn't changed
110 *\li > 0 - zname is now valid, and return value is number of addrs[] found
112 * notes:
113 *\li this function calls res_nsend() which means it depends on correctly
114 * functioning recursive nameservers (usually defined in /etc/resolv.conf
115 * or its local equivilent).
117 *\li we start by asking for an SOA<dname,class>. if we get one as an
118 * answer, that just means <dname,class> is a zone top, which is fine.
119 * more than likely we'll be told to go pound sand, in the form of a
120 * negative answer.
122 *\li note that we are not prepared to deal with referrals since that would
123 * only come from authority servers and our correctly functioning local
124 * recursive server would have followed the referral and got us something
125 * more definite.
127 *\li if the authority section contains an SOA, this SOA should also be the
128 * closest enclosing zone, since any intermediary zone cuts would've been
129 * returned as referrals and dealt with by our correctly functioning local
130 * recursive name server. but an SOA in the authority section should NOT
131 * match our dname (since that would have been returned in the answer
132 * section). an authority section SOA has to be "above" our dname.
134 *\li however, since authority section SOA's were once optional, it's
135 * possible that we'll have to go hunting for the enclosing SOA by
136 * ripping labels off the front of our dname -- this is known as "doing
137 * it the hard way."
139 *\li ultimately we want some server addresses, which are ideally the ones
140 * pertaining to the SOA.MNAME, but only if there is a matching NS RR.
141 * so the second phase (after we find an SOA) is to go looking for the
142 * NS RRset for that SOA's zone.
144 *\li no answer section processed by this code is allowed to contain CNAME
145 * or DNAME RR's. for the SOA query this means we strip a label and
146 * keep going. for the NS and A queries this means we just give up.
150 res_findzonecut(res_state statp, const char *dname, ns_class class, int opts,
151 char *zname, size_t zsize, struct in_addr *addrs, int naddrs)
153 int result, i;
154 union res_sockaddr_union *u;
157 opts |= RES_IPV4ONLY;
158 opts &= ~RES_IPV6ONLY;
160 u = calloc(naddrs, sizeof(*u));
161 if (u == NULL)
162 return(-1);
164 result = res_findzonecut2(statp, dname, class, opts, zname, zsize,
165 u, naddrs);
167 for (i = 0; i < result; i++) {
168 addrs[i] = u[i].sin.sin_addr;
170 free(u);
171 return (result);
175 res_findzonecut2(res_state statp, const char *dname, ns_class class, int opts,
176 char *zname, size_t zsize, union res_sockaddr_union *addrs,
177 int naddrs)
179 char mname[NS_MAXDNAME];
180 u_long save_pfcode;
181 rrset_ns nsrrs;
182 int n;
184 DPRINTF(("START dname='%s' class=%s, zsize=%ld, naddrs=%d",
185 dname, p_class(class), (long)zsize, naddrs));
186 save_pfcode = statp->pfcode;
187 statp->pfcode |= RES_PRF_HEAD2 | RES_PRF_HEAD1 | RES_PRF_HEADX |
188 RES_PRF_QUES | RES_PRF_ANS |
189 RES_PRF_AUTH | RES_PRF_ADD;
190 INIT_LIST(nsrrs);
192 DPRINTF(("get the soa, and see if it has enough glue"));
193 if ((n = get_soa(statp, dname, class, opts, zname, zsize,
194 mname, sizeof mname, &nsrrs)) < 0 ||
195 ((opts & RES_EXHAUSTIVE) == 0 &&
196 (n = satisfy(statp, mname, &nsrrs, addrs, naddrs)) > 0))
197 goto done;
199 DPRINTF(("get the ns rrset and see if it has enough glue"));
200 if ((n = get_ns(statp, zname, class, opts, &nsrrs)) < 0 ||
201 ((opts & RES_EXHAUSTIVE) == 0 &&
202 (n = satisfy(statp, mname, &nsrrs, addrs, naddrs)) > 0))
203 goto done;
205 DPRINTF(("get the missing glue and see if it's finally enough"));
206 if ((n = get_glue(statp, class, opts, &nsrrs)) >= 0)
207 n = satisfy(statp, mname, &nsrrs, addrs, naddrs);
209 done:
210 DPRINTF(("FINISH n=%d (%s)", n, (n < 0) ? strerror(errno) : "OK"));
211 free_nsrrset(&nsrrs);
212 statp->pfcode = save_pfcode;
213 return (n);
216 /* Private. */
218 static int
219 satisfy(res_state statp, const char *mname, rrset_ns *nsrrsp,
220 union res_sockaddr_union *addrs, int naddrs)
222 rr_ns *nsrr;
223 int n, x;
225 n = 0;
226 nsrr = find_ns(nsrrsp, mname);
227 if (nsrr != NULL) {
228 x = add_addrs(statp, nsrr, addrs, naddrs);
229 addrs += x;
230 naddrs -= x;
231 n += x;
233 for (nsrr = HEAD(*nsrrsp);
234 nsrr != NULL && naddrs > 0;
235 nsrr = NEXT(nsrr, link))
236 if (ns_samename(nsrr->name, mname) != 1) {
237 x = add_addrs(statp, nsrr, addrs, naddrs);
238 addrs += x;
239 naddrs -= x;
240 n += x;
242 DPRINTF(("satisfy(%s): %d", mname, n));
243 return (n);
246 static int
247 add_addrs(res_state statp, rr_ns *nsrr,
248 union res_sockaddr_union *addrs, int naddrs)
250 rr_a *arr;
251 int n = 0;
253 for (arr = HEAD(nsrr->addrs); arr != NULL; arr = NEXT(arr, link)) {
254 if (naddrs <= 0)
255 return (0);
256 *addrs++ = arr->addr;
257 naddrs--;
258 n++;
260 DPRINTF(("add_addrs: %d", n));
261 return (n);
264 static int
265 get_soa(res_state statp, const char *dname, ns_class class, int opts,
266 char *zname, size_t zsize, char *mname, size_t msize,
267 rrset_ns *nsrrsp)
269 char tname[NS_MAXDNAME];
270 u_char *resp = NULL;
271 int n, i, ancount, nscount;
272 ns_sect sect;
273 ns_msg msg;
274 u_int rcode;
277 * Find closest enclosing SOA, even if it's for the root zone.
280 /* First canonicalize dname (exactly one unescaped trailing "."). */
281 if (ns_makecanon(dname, tname, sizeof tname) < 0)
282 goto cleanup;
283 dname = tname;
285 resp = malloc(NS_MAXMSG);
286 if (resp == NULL)
287 goto cleanup;
289 /* Now grovel the subdomains, hunting for an SOA answer or auth. */
290 for (;;) {
291 /* Leading or inter-label '.' are skipped here. */
292 while (*dname == '.')
293 dname++;
295 /* Is there an SOA? */
296 n = do_query(statp, dname, class, ns_t_soa, resp, &msg);
297 if (n < 0) {
298 DPRINTF(("get_soa: do_query('%s', %s) failed (%d)",
299 dname, p_class(class), n));
300 goto cleanup;
302 if (n > 0) {
303 DPRINTF(("get_soa: CNAME or DNAME found"));
304 sect = ns_s_max, n = 0;
305 } else {
306 rcode = ns_msg_getflag(msg, ns_f_rcode);
307 ancount = ns_msg_count(msg, ns_s_an);
308 nscount = ns_msg_count(msg, ns_s_ns);
309 if (ancount > 0 && rcode == ns_r_noerror)
310 sect = ns_s_an, n = ancount;
311 else if (nscount > 0)
312 sect = ns_s_ns, n = nscount;
313 else
314 sect = ns_s_max, n = 0;
316 for (i = 0; i < n; i++) {
317 const char *t;
318 const u_char *rdata;
319 ns_rr rr;
321 if (ns_parserr(&msg, sect, i, &rr) < 0) {
322 DPRINTF(("get_soa: ns_parserr(%s, %d) failed",
323 p_section(sect, ns_o_query), i));
324 goto cleanup;
326 if (ns_rr_type(rr) == ns_t_cname ||
327 ns_rr_type(rr) == ns_t_dname)
328 break;
329 if (ns_rr_type(rr) != ns_t_soa ||
330 ns_rr_class(rr) != class)
331 continue;
332 t = ns_rr_name(rr);
333 switch (sect) {
334 case ns_s_an:
335 if (ns_samedomain(dname, t) == 0) {
336 DPRINTF(
337 ("get_soa: ns_samedomain('%s', '%s') == 0",
338 dname, t)
340 errno = EPROTOTYPE;
341 goto cleanup;
343 break;
344 case ns_s_ns:
345 if (ns_samename(dname, t) == 1 ||
346 ns_samedomain(dname, t) == 0) {
347 DPRINTF(
348 ("get_soa: ns_samename() || !ns_samedomain('%s', '%s')",
349 dname, t)
351 errno = EPROTOTYPE;
352 goto cleanup;
354 break;
355 default:
356 abort();
358 if (strlen(t) + 1 > zsize) {
359 DPRINTF(("get_soa: zname(%lu) too small (%lu)",
360 (unsigned long)zsize,
361 (unsigned long)strlen(t) + 1));
362 errno = EMSGSIZE;
363 goto cleanup;
365 strcpy(zname, t);
366 rdata = ns_rr_rdata(rr);
367 if (ns_name_uncompress(resp, ns_msg_end(msg), rdata,
368 mname, msize) < 0) {
369 DPRINTF(("get_soa: ns_name_uncompress failed")
371 goto cleanup;
373 if (save_ns(statp, &msg, ns_s_ns,
374 zname, class, opts, nsrrsp) < 0) {
375 DPRINTF(("get_soa: save_ns failed"));
376 goto cleanup;
378 free(resp);
379 return (0);
382 /* If we're out of labels, then not even "." has an SOA! */
383 if (*dname == '\0')
384 break;
386 /* Find label-terminating "."; top of loop will skip it. */
387 while (*dname != '.') {
388 if (*dname == '\\')
389 if (*++dname == '\0') {
390 errno = EMSGSIZE;
391 goto cleanup;
393 dname++;
396 DPRINTF(("get_soa: out of labels"));
397 errno = EDESTADDRREQ;
398 cleanup:
399 free(resp);
400 return (-1);
403 static int
404 get_ns(res_state statp, const char *zname, ns_class class, int opts,
405 rrset_ns *nsrrsp)
407 u_char *resp;
408 ns_msg msg;
409 int n;
411 resp = malloc(NS_MAXMSG);
412 if (resp == NULL)
413 return (-1);
415 /* Go and get the NS RRs for this zone. */
416 n = do_query(statp, zname, class, ns_t_ns, resp, &msg);
417 if (n != 0) {
418 DPRINTF(("get_ns: do_query('%s', %s) failed (%d)",
419 zname, p_class(class), n));
420 free(resp);
421 return (-1);
424 /* Remember the NS RRs and associated A RRs that came back. */
425 if (save_ns(statp, &msg, ns_s_an, zname, class, opts, nsrrsp) < 0) {
426 DPRINTF(("get_ns save_ns('%s', %s) failed",
427 zname, p_class(class)));
428 free(resp);
429 return (-1);
432 free(resp);
433 return (0);
436 static int
437 get_glue(res_state statp, ns_class class, int opts, rrset_ns *nsrrsp) {
438 rr_ns *nsrr, *nsrr_n;
439 u_char *resp;
441 resp = malloc(NS_MAXMSG);
442 if (resp == NULL)
443 return(-1);
445 /* Go and get the A RRs for each empty NS RR on our list. */
446 for (nsrr = HEAD(*nsrrsp); nsrr != NULL; nsrr = nsrr_n) {
447 ns_msg msg;
448 int n;
450 nsrr_n = NEXT(nsrr, link);
452 if ((nsrr->flags & RR_NS_HAVE_V4) == 0) {
453 n = do_query(statp, nsrr->name, class, ns_t_a,
454 resp, &msg);
455 if (n < 0) {
456 DPRINTF(
457 ("get_glue: do_query('%s', %s') failed",
458 nsrr->name, p_class(class)));
459 goto cleanup;
461 if (n > 0) {
462 DPRINTF((
463 "get_glue: do_query('%s', %s') CNAME or DNAME found",
464 nsrr->name, p_class(class)));
466 if (save_a(statp, &msg, ns_s_an, nsrr->name, class,
467 opts, nsrr) < 0) {
468 DPRINTF(("get_glue: save_r('%s', %s) failed",
469 nsrr->name, p_class(class)));
470 goto cleanup;
474 if ((nsrr->flags & RR_NS_HAVE_V6) == 0) {
475 n = do_query(statp, nsrr->name, class, ns_t_aaaa,
476 resp, &msg);
477 if (n < 0) {
478 DPRINTF(
479 ("get_glue: do_query('%s', %s') failed",
480 nsrr->name, p_class(class)));
481 goto cleanup;
483 if (n > 0) {
484 DPRINTF((
485 "get_glue: do_query('%s', %s') CNAME or DNAME found",
486 nsrr->name, p_class(class)));
488 if (save_a(statp, &msg, ns_s_an, nsrr->name, class,
489 opts, nsrr) < 0) {
490 DPRINTF(("get_glue: save_r('%s', %s) failed",
491 nsrr->name, p_class(class)));
492 goto cleanup;
496 /* If it's still empty, it's just chaff. */
497 if (EMPTY(nsrr->addrs)) {
498 DPRINTF(("get_glue: removing empty '%s' NS",
499 nsrr->name));
500 free_nsrr(nsrrsp, nsrr);
503 free(resp);
504 return (0);
506 cleanup:
507 free(resp);
508 return (-1);
511 static int
512 save_ns(res_state statp, ns_msg *msg, ns_sect sect,
513 const char *owner, ns_class class, int opts,
514 rrset_ns *nsrrsp)
516 int i;
518 for (i = 0; i < ns_msg_count(*msg, sect); i++) {
519 char tname[MAXDNAME];
520 const u_char *rdata;
521 rr_ns *nsrr;
522 ns_rr rr;
524 if (ns_parserr(msg, sect, i, &rr) < 0) {
525 DPRINTF(("save_ns: ns_parserr(%s, %d) failed",
526 p_section(sect, ns_o_query), i));
527 return (-1);
529 if (ns_rr_type(rr) != ns_t_ns ||
530 ns_rr_class(rr) != class ||
531 ns_samename(ns_rr_name(rr), owner) != 1)
532 continue;
533 nsrr = find_ns(nsrrsp, ns_rr_name(rr));
534 if (nsrr == NULL) {
535 nsrr = malloc(sizeof *nsrr);
536 if (nsrr == NULL) {
537 DPRINTF(("save_ns: malloc failed"));
538 return (-1);
540 rdata = ns_rr_rdata(rr);
541 if (ns_name_uncompress(ns_msg_base(*msg),
542 ns_msg_end(*msg), rdata,
543 tname, sizeof tname) < 0) {
544 DPRINTF(("save_ns: ns_name_uncompress failed")
546 free(nsrr);
547 return (-1);
549 nsrr->name = strdup(tname);
550 if (nsrr->name == NULL) {
551 DPRINTF(("save_ns: strdup failed"));
552 free(nsrr);
553 return (-1);
555 INIT_LINK(nsrr, link);
556 INIT_LIST(nsrr->addrs);
557 nsrr->flags = 0;
558 APPEND(*nsrrsp, nsrr, link);
560 if (save_a(statp, msg, ns_s_ar,
561 nsrr->name, class, opts, nsrr) < 0) {
562 DPRINTF(("save_ns: save_r('%s', %s) failed",
563 nsrr->name, p_class(class)));
564 return (-1);
567 return (0);
570 static int
571 save_a(res_state statp, ns_msg *msg, ns_sect sect,
572 const char *owner, ns_class class, int opts,
573 rr_ns *nsrr)
575 int i;
577 for (i = 0; i < ns_msg_count(*msg, sect); i++) {
578 ns_rr rr;
579 rr_a *arr;
581 if (ns_parserr(msg, sect, i, &rr) < 0) {
582 DPRINTF(("save_a: ns_parserr(%s, %d) failed",
583 p_section(sect, ns_o_query), i));
584 return (-1);
586 if ((ns_rr_type(rr) != ns_t_a &&
587 ns_rr_type(rr) != ns_t_aaaa) ||
588 ns_rr_class(rr) != class ||
589 ns_samename(ns_rr_name(rr), owner) != 1 ||
590 ns_rr_rdlen(rr) != NS_INADDRSZ)
591 continue;
592 if ((opts & RES_IPV6ONLY) != 0 && ns_rr_type(rr) != ns_t_aaaa)
593 continue;
594 if ((opts & RES_IPV4ONLY) != 0 && ns_rr_type(rr) != ns_t_a)
595 continue;
596 arr = malloc(sizeof *arr);
597 if (arr == NULL) {
598 DPRINTF(("save_a: malloc failed"));
599 return (-1);
601 INIT_LINK(arr, link);
602 memset(&arr->addr, 0, sizeof(arr->addr));
603 switch (ns_rr_type(rr)) {
604 case ns_t_a:
605 arr->addr.sin.sin_family = AF_INET;
606 #ifdef HAVE_SA_LEN
607 arr->addr.sin.sin_len = sizeof(arr->addr.sin);
608 #endif
609 memcpy(&arr->addr.sin.sin_addr, ns_rr_rdata(rr),
610 NS_INADDRSZ);
611 arr->addr.sin.sin_port = htons(NAMESERVER_PORT);
612 nsrr->flags |= RR_NS_HAVE_V4;
613 break;
614 case ns_t_aaaa:
615 arr->addr.sin6.sin6_family = AF_INET6;
616 #ifdef HAVE_SA_LEN
617 arr->addr.sin6.sin6_len = sizeof(arr->addr.sin6);
618 #endif
619 memcpy(&arr->addr.sin6.sin6_addr, ns_rr_rdata(rr), 16);
620 arr->addr.sin.sin_port = htons(NAMESERVER_PORT);
621 nsrr->flags |= RR_NS_HAVE_V6;
622 break;
623 default:
624 abort();
626 APPEND(nsrr->addrs, arr, link);
628 return (0);
631 static void
632 free_nsrrset(rrset_ns *nsrrsp) {
633 rr_ns *nsrr;
635 while ((nsrr = HEAD(*nsrrsp)) != NULL)
636 free_nsrr(nsrrsp, nsrr);
639 static void
640 free_nsrr(rrset_ns *nsrrsp, rr_ns *nsrr) {
641 rr_a *arr;
642 char *tmp;
644 while ((arr = HEAD(nsrr->addrs)) != NULL) {
645 UNLINK(nsrr->addrs, arr, link);
646 free(arr);
648 DE_CONST(nsrr->name, tmp);
649 free(tmp);
650 UNLINK(*nsrrsp, nsrr, link);
651 free(nsrr);
654 static rr_ns *
655 find_ns(rrset_ns *nsrrsp, const char *dname) {
656 rr_ns *nsrr;
658 for (nsrr = HEAD(*nsrrsp); nsrr != NULL; nsrr = NEXT(nsrr, link))
659 if (ns_samename(nsrr->name, dname) == 1)
660 return (nsrr);
661 return (NULL);
664 static int
665 do_query(res_state statp, const char *dname, ns_class class, ns_type qtype,
666 u_char *resp, ns_msg *msg)
668 u_char req[NS_PACKETSZ];
669 int i, n;
671 n = res_nmkquery(statp, ns_o_query, dname, class, qtype,
672 NULL, 0, NULL, req, NS_PACKETSZ);
673 if (n < 0) {
674 DPRINTF(("do_query: res_nmkquery failed"));
675 return (-1);
677 n = res_nsend(statp, req, n, resp, NS_MAXMSG);
678 if (n < 0) {
679 DPRINTF(("do_query: res_nsend failed"));
680 return (-1);
682 if (n == 0) {
683 DPRINTF(("do_query: res_nsend returned 0"));
684 errno = EMSGSIZE;
685 return (-1);
687 if (ns_initparse(resp, n, msg) < 0) {
688 DPRINTF(("do_query: ns_initparse failed"));
689 return (-1);
691 n = 0;
692 for (i = 0; i < ns_msg_count(*msg, ns_s_an); i++) {
693 ns_rr rr;
695 if (ns_parserr(msg, ns_s_an, i, &rr) < 0) {
696 DPRINTF(("do_query: ns_parserr failed"));
697 return (-1);
699 n += (ns_rr_class(rr) == class &&
700 (ns_rr_type(rr) == ns_t_cname ||
701 ns_rr_type(rr) == ns_t_dname));
703 return (n);
706 static void
707 res_dprintf(const char *fmt, ...) {
708 va_list ap;
710 va_start(ap, fmt);
711 fputs(";; res_findzonecut: ", stderr);
712 vfprintf(stderr, fmt, ap);
713 fputc('\n', stderr);
714 va_end(ap);
717 /*! \file */