View | Details | Raw Unified | Return to bug 209177 | Differences between
and this patch

Collapse All | Expand All

(-)contrib/ldns-host/ldns-host.1 (-3 lines)
Lines 236-244 Link Here
236
.Sq host
236
.Sq host
237
from BIND9 uses whatever command was specified last.
237
from BIND9 uses whatever command was specified last.
238
.It
238
.It
239
Multi-packet zone transfers are not supported; only the first
240
response packet is printed.
241
.It
242
.Sq Pseudosection TSIG
239
.Sq Pseudosection TSIG
243
is missing from verbose packet output.
240
is missing from verbose packet output.
244
.El
241
.El
(-)contrib/ldns-host/ldns-host.c (-44 / +203 lines)
Lines 7-22 Link Here
7
 * without any warranty.
7
 * without any warranty.
8
 */
8
 */
9
9
10
#include <netinet/in.h>
10
#include <ldns/ldns.h>
11
12
#include <limits.h>
11
#include <limits.h>
13
#include <netdb.h>
12
#include <netdb.h>
13
#include <netinet/in.h>
14
#include <stdio.h>
14
#include <stdio.h>
15
#include <stdlib.h>
15
#include <stdlib.h>
16
#include <unistd.h>
16
#include <unistd.h>
17
17
18
#include <ldns/ldns.h>
19
20
/* General utilities.
18
/* General utilities.
21
 */
19
 */
22
20
Lines 159-169 Link Here
159
}
157
}
160
158
161
static ldns_status
159
static ldns_status
160
ldns_tcp_start(ldns_resolver *res, ldns_pkt *qpkt, int nameserver) {
161
    /* This routine is based on ldns_axfr_start, with the major
162
     * difference in that it takes a query packet explicitly.
163
     */
164
    struct sockaddr_storage *ns = NULL;
165
    size_t ns_len = 0;
166
    ldns_buffer *qbuf = NULL;
167
    ldns_status status;
168
169
    ns = ldns_rdf2native_sockaddr_storage(
170
            res->_nameservers[nameserver], ldns_resolver_port(res), &ns_len);
171
    if (ns == NULL) {
172
        status = LDNS_STATUS_MEM_ERR;
173
        goto error;
174
    }
175
176
    res->_socket = ldns_tcp_connect(
177
            ns, (socklen_t)ns_len, ldns_resolver_timeout(res));
178
    if (res->_socket <= 0) {
179
        status = LDNS_STATUS_ADDRESS_ERR;
180
        goto error;
181
    }
182
183
    qbuf = ldns_buffer_new(LDNS_MAX_PACKETLEN);
184
    if (qbuf == NULL) {
185
        status = LDNS_STATUS_MEM_ERR;
186
        goto error;
187
    }
188
189
    status = ldns_pkt2buffer_wire(qbuf, qpkt);
190
    if (status != LDNS_STATUS_OK)
191
        goto error;
192
193
    if (ldns_tcp_send_query(qbuf, res->_socket, ns, (socklen_t)ns_len) == 0) {
194
        status = LDNS_STATUS_NETWORK_ERR;
195
        goto error;
196
    }
197
198
    ldns_buffer_free(qbuf);
199
    free(ns);
200
    return LDNS_STATUS_OK;
201
 
202
error:
203
    ldns_buffer_free(qbuf);
204
    free(ns);
205
    if (res->_socket > 0) {
206
        close(res->_socket);
207
        res->_socket = 0;
208
    }
209
    return status;
210
}
211
212
static ldns_status
213
ldns_tcp_read(ldns_pkt **answer, ldns_resolver *res) {
214
    ldns_status status;
215
    struct timeval t1, t2;
216
    uint8_t *data;
217
    size_t size;
218
219
    if (res->_socket <= 0)
220
        return LDNS_STATUS_ERR;
221
222
    gettimeofday(&t1, NULL);
223
    data = ldns_tcp_read_wire_timeout(
224
            res->_socket, &size, ldns_resolver_timeout(res));
225
    if (data == NULL)
226
        goto error;
227
228
    status = ldns_wire2pkt(answer, data, size);
229
    free(data);
230
    if (status != LDNS_STATUS_OK)
231
        goto error;
232
233
    gettimeofday(&t2, NULL);
234
    ldns_pkt_set_querytime(*answer,
235
            (uint32_t)((t2.tv_sec - t1.tv_sec)*1000) +
236
                (t2.tv_usec - t1.tv_usec)/1000);
237
    ldns_pkt_set_timestamp(*answer, t2);
238
    return status;
239
240
error:
241
    close(res->_socket);
242
    res->_socket = 0;
243
    return LDNS_STATUS_ERR;
244
}
245
246
static void
247
ldns_tcp_close(ldns_resolver *res) {
248
    if (res->_socket > 0) {
249
        close(res->_socket);
250
        res->_socket = 0;
251
    }
252
}
253
254
static ldns_status
162
ldns_resolver_send_to(ldns_pkt **answer, ldns_resolver *res,
255
ldns_resolver_send_to(ldns_pkt **answer, ldns_resolver *res,
163
    const ldns_rdf *name, ldns_rr_type t, ldns_rr_class c,
256
    const ldns_rdf *name, ldns_rr_type t, ldns_rr_class c,
164
    uint16_t flags, uint32_t ixfr_serial, int nameserver) {
257
    uint16_t flags, uint32_t ixfr_serial, int nameserver,
165
    ldns_status status;
258
    bool close_tcp) {
259
    ldns_status status = LDNS_STATUS_OK;
166
    ldns_pkt *qpkt;
260
    ldns_pkt *qpkt;
261
    struct timeval now;
167
262
168
    int nscnt = ldns_resolver_nameserver_count(res);
263
    int nscnt = ldns_resolver_nameserver_count(res);
169
    ldns_rdf **ns = ldns_resolver_nameservers(res);
264
    ldns_rdf **ns = ldns_resolver_nameservers(res);
Lines 173-184 Link Here
173
    ldns_resolver_set_rtt(res, &rtt[nameserver]);
268
    ldns_resolver_set_rtt(res, &rtt[nameserver]);
174
    ldns_resolver_set_nameserver_count(res, 1);
269
    ldns_resolver_set_nameserver_count(res, 1);
175
270
176
    status = ldns_resolver_prepare_query_pkt(&qpkt, res, name, t, c, flags);
271
    /* The next fragment should have been a call to
177
    if (status == LDNS_STATUS_OK && t == LDNS_RR_TYPE_IXFR)
272
     * ldns_resolver_prepare_query_pkt(), but starting with ldns
273
     * version 1.6.17 that function tries to add it's own SOA
274
     * records when rr_type is LDNS_RR_TYPE_IXFR, and we don't
275
     * want that.
276
     */
277
    qpkt = ldns_pkt_query_new(ldns_rdf_clone(name), t, c, flags);
278
    if (qpkt == NULL) {
279
        status = LDNS_STATUS_ERR;
280
        goto done;
281
    }
282
    now.tv_sec = time(NULL);
283
    now.tv_usec = 0;
284
    ldns_pkt_set_timestamp(qpkt, now);
285
    ldns_pkt_set_random_id(qpkt);
286
287
    if (t == LDNS_RR_TYPE_IXFR) {
178
        status = ldns_pkt_push_rr_soa(qpkt,
288
        status = ldns_pkt_push_rr_soa(qpkt,
179
            LDNS_SECTION_AUTHORITY, name, c, ixfr_serial);
289
            LDNS_SECTION_AUTHORITY, name, c, ixfr_serial);
180
    if (status == LDNS_STATUS_OK)
290
        if (status != LDNS_STATUS_OK) goto done;
291
    }
292
    if (close_tcp) {
181
        status = ldns_resolver_send_pkt(answer, res, qpkt);
293
        status = ldns_resolver_send_pkt(answer, res, qpkt);
294
    } else {
295
        status = ldns_tcp_start(res, qpkt, 0);
296
        if (status != LDNS_STATUS_OK) goto done;
297
        status = ldns_tcp_read(answer, res);
298
        if (status != LDNS_STATUS_OK) goto done;
299
        ldns_pkt_set_answerfrom(*answer, ldns_rdf_clone(ns[0]));
300
    }
301
302
done:
182
    ldns_pkt_free(qpkt);
303
    ldns_pkt_free(qpkt);
183
304
184
    ldns_resolver_set_nameservers(res, ns);
305
    ldns_resolver_set_nameservers(res, ns);
Lines 203-211 Link Here
203
            type == rrtype ||
324
            type == rrtype ||
204
            (type == LDNS_RR_TYPE_AXFR &&
325
            (type == LDNS_RR_TYPE_AXFR &&
205
                (rrtype == LDNS_RR_TYPE_A ||
326
                (rrtype == LDNS_RR_TYPE_A ||
206
		    rrtype == LDNS_RR_TYPE_AAAA ||
327
                rrtype == LDNS_RR_TYPE_AAAA ||
207
		    rrtype == LDNS_RR_TYPE_NS ||
328
                rrtype == LDNS_RR_TYPE_NS ||
208
		    rrtype == LDNS_RR_TYPE_PTR)))
329
                rrtype == LDNS_RR_TYPE_PTR)))
209
            ldns_rr_list_set_rr(rrlist, rr, j++);
330
            ldns_rr_list_set_rr(rrlist, rr, j++);
210
    }
331
    }
211
    ldns_rr_list_set_rr_count(rrlist, j);
332
    ldns_rr_list_set_rr_count(rrlist, j);
Lines 438-444 Link Here
438
#define DEFAULT_TCP_TIMEOUT 10
559
#define DEFAULT_TCP_TIMEOUT 10
439
#define DEFAULT_UDP_TIMEOUT 5
560
#define DEFAULT_UDP_TIMEOUT 5
440
561
441
enum operation_mode { M_AXFR, M_DEFAULT_Q, M_SINGLE_Q, M_SOA };
562
enum operation_mode { M_AXFR, M_IXFR, M_DEFAULT_Q, M_SINGLE_Q, M_SOA };
442
563
443
static enum operation_mode o_mode = M_DEFAULT_Q;
564
static enum operation_mode o_mode = M_DEFAULT_Q;
444
static bool o_ignore_servfail = true;
565
static bool o_ignore_servfail = true;
Lines 454-468 Link Here
454
static int o_ndots = 1;
575
static int o_ndots = 1;
455
static int o_retries = 1;
576
static int o_retries = 1;
456
static ldns_rr_class o_rrclass = LDNS_RR_CLASS_IN;
577
static ldns_rr_class o_rrclass = LDNS_RR_CLASS_IN;
457
static ldns_rr_type o_rrtype = LDNS_RR_TYPE_A;
578
static ldns_rr_type o_rrtype = (ldns_rr_type)-1;
458
static time_t o_timeout = 0;
579
static time_t o_timeout = 0;
459
static uint32_t o_ixfr_serial = 0;
580
static uint32_t o_ixfr_serial = 0;
460
581
461
static void
582
static void
462
usage(void) {
583
usage(void) {
463
    fputs(
584
    fprintf(stderr,
464
    "Usage: host [-aCdilrsTvw46] [-c class] [-N ndots] [-R number]\n"
585
    "Usage: %s [-aCdilrsTvw46] [-c class] [-N ndots] [-R number]\n"
465
    "            [-t type] [-W wait] name [server]\n"
586
    "       %*c [-t type] [-W wait] name [server]\n"
466
    "\t-a same as -v -t ANY\n"
587
    "\t-a same as -v -t ANY\n"
467
    "\t-C query SOA records from all authoritative name servers\n"
588
    "\t-C query SOA records from all authoritative name servers\n"
468
    "\t-c use this query class (IN, CH, HS, etc)\n"
589
    "\t-c use this query class (IN, CH, HS, etc)\n"
Lines 480-486 Link Here
480
    "\t-W wait this many seconds for a reply\n"
601
    "\t-W wait this many seconds for a reply\n"
481
    "\t-4 use IPv4 only\n"
602
    "\t-4 use IPv4 only\n"
482
    "\t-6 use IPv6 only\n",
603
    "\t-6 use IPv6 only\n",
483
    stderr);
604
    progname, (int)strlen(progname), ' ');
484
    exit(1);
605
    exit(1);
485
}
606
}
486
607
Lines 513-519 Link Here
513
        case 'i': o_ip6_int = true; break;
634
        case 'i': o_ip6_int = true; break;
514
        case 'l':
635
        case 'l':
515
            o_mode = M_AXFR;
636
            o_mode = M_AXFR;
516
            o_rrtype = LDNS_RR_TYPE_AXFR;
637
            if (o_rrtype == (ldns_rr_type)-1)
638
                o_rrtype = LDNS_RR_TYPE_AXFR;
517
            o_tcp = true;
639
            o_tcp = true;
518
            break;
640
            break;
519
        case 'N':
641
        case 'N':
Lines 542-554 Link Here
542
                if (o_rrtype <= 0)
664
                if (o_rrtype <= 0)
543
                    die(2, "invalid type: %s\n", optarg);
665
                    die(2, "invalid type: %s\n", optarg);
544
            }
666
            }
545
            if (o_rrtype == LDNS_RR_TYPE_AXFR || o_rrtype == LDNS_RR_TYPE_IXFR)
546
                o_tcp = true;
547
            if (o_rrtype == LDNS_RR_TYPE_AXFR) {
667
            if (o_rrtype == LDNS_RR_TYPE_AXFR) {
548
                o_mode = M_AXFR;
668
                o_mode = M_AXFR;
549
                o_rrtype = LDNS_RR_TYPE_ANY;
669
                o_rrtype = LDNS_RR_TYPE_ANY;
550
                o_verbose = true;
670
                o_verbose = true;
551
            }
671
            }
672
            if (o_rrtype == LDNS_RR_TYPE_IXFR) {
673
                o_mode = M_IXFR;
674
                o_rrtype = LDNS_RR_TYPE_ANY;
675
            }
552
            break;
676
            break;
553
        case 'v': o_verbose = true; break;
677
        case 'v': o_verbose = true; break;
554
        case 'w':
678
        case 'w':
Lines 574-579 Link Here
574
        o_server = argv[1];
698
        o_server = argv[1];
575
        o_print_pkt_server = true;
699
        o_print_pkt_server = true;
576
    }
700
    }
701
    if (o_rrtype == (ldns_rr_type)-1)
702
        o_rrtype = LDNS_RR_TYPE_A;
577
}
703
}
578
704
579
static ldns_rdf*
705
static ldns_rdf*
Lines 602-608 Link Here
602
}
728
}
603
729
604
static bool
730
static bool
605
query(ldns_resolver *res, ldns_rdf *domain, ldns_pkt **pkt) {
731
query(ldns_resolver *res, ldns_rdf *domain, ldns_pkt **pkt, bool close_tcp) {
606
    ldns_status status;
732
    ldns_status status;
607
    ldns_pkt_rcode rcode;
733
    ldns_pkt_rcode rcode;
608
    int i, cnt;
734
    int i, cnt;
Lines 614-620 Link Here
614
    }
740
    }
615
    for (cnt = ldns_resolver_nameserver_count(res), i = 0; i < cnt; i++) {
741
    for (cnt = ldns_resolver_nameserver_count(res), i = 0; i < cnt; i++) {
616
        status = ldns_resolver_send_to(pkt, res, domain, o_rrtype,
742
        status = ldns_resolver_send_to(pkt, res, domain, o_rrtype,
617
            o_rrclass, o_recursive ? LDNS_RD : 0, o_ixfr_serial, i);
743
            o_rrclass, o_recursive ? LDNS_RD : 0, o_ixfr_serial, i,
744
            close_tcp);
618
        if (status != LDNS_STATUS_OK) {
745
        if (status != LDNS_STATUS_OK) {
619
            *pkt = NULL;
746
            *pkt = NULL;
620
            continue;
747
            continue;
Lines 624-630 Link Here
624
                printf(";; Truncated, retrying in TCP mode.\n");
751
                printf(";; Truncated, retrying in TCP mode.\n");
625
            ldns_resolver_set_usevc(res, true);
752
            ldns_resolver_set_usevc(res, true);
626
            status = ldns_resolver_send_to(pkt, res, domain, o_rrtype,
753
            status = ldns_resolver_send_to(pkt, res, domain, o_rrtype,
627
                o_rrclass, o_recursive ? LDNS_RD : 0, o_ixfr_serial, i);
754
                o_rrclass, o_recursive ? LDNS_RD : 0, o_ixfr_serial, i,
755
                close_tcp);
628
            ldns_resolver_set_usevc(res, false);
756
            ldns_resolver_set_usevc(res, false);
629
            if (status != LDNS_STATUS_OK)
757
            if (status != LDNS_STATUS_OK)
630
                continue;
758
                continue;
Lines 642-657 Link Here
642
}
770
}
643
771
644
static ldns_rdf *
772
static ldns_rdf *
645
search(ldns_resolver *res, ldns_rdf *domain, ldns_pkt **pkt, bool absolute) {
773
search(ldns_resolver *res, ldns_rdf *domain, ldns_pkt **pkt,
774
    bool absolute, bool close_tcp) {
646
    ldns_rdf *dname, **searchlist;
775
    ldns_rdf *dname, **searchlist;
647
    int i, n;
776
    int i, n;
648
777
649
    if (absolute && query(res, domain, pkt))
778
    if (absolute && query(res, domain, pkt, close_tcp))
650
        return domain;
779
        return domain;
651
780
652
    if ((dname = ldns_resolver_domain(res)) != NULL) {
781
    if ((dname = ldns_resolver_domain(res)) != NULL) {
653
        dname = safe_dname_cat_clone(domain, dname);
782
        dname = safe_dname_cat_clone(domain, dname);
654
        if (query(res, dname, pkt))
783
        if (query(res, dname, pkt, close_tcp))
655
            return dname;
784
            return dname;
656
    }
785
    }
657
786
Lines 659-669 Link Here
659
    n = ldns_resolver_searchlist_count(res);
788
    n = ldns_resolver_searchlist_count(res);
660
    for (i = 0; i < n; i++) {
789
    for (i = 0; i < n; i++) {
661
        dname = safe_dname_cat_clone(domain, searchlist[i]);
790
        dname = safe_dname_cat_clone(domain, searchlist[i]);
662
        if (query(res, dname, pkt))
791
        if (query(res, dname, pkt, close_tcp))
663
            return dname;
792
            return dname;
664
    }
793
    }
665
794
666
    if (!absolute && query(res, domain, pkt))
795
    if (!absolute && query(res, domain, pkt, close_tcp))
667
        return domain;
796
        return domain;
668
797
669
    return NULL;
798
    return NULL;
Lines 691-697 Link Here
691
            print_pkt_verbose(pkt);
820
            print_pkt_verbose(pkt);
692
        } else {
821
        } else {
693
            print_pkt_short(pkt, o_print_rr_server);
822
            print_pkt_short(pkt, o_print_rr_server);
694
            if (o_mode != M_DEFAULT_Q &&
823
            if (o_mode == M_SINGLE_Q &&
695
                ldns_rr_list_rr_count(ldns_pkt_answer(pkt)) == 0) {
824
                ldns_rr_list_rr_count(ldns_pkt_answer(pkt)) == 0) {
696
                print_rdf_nodot(domain);
825
                print_rdf_nodot(domain);
697
                printf(" has no ");
826
                printf(" has no ");
Lines 709-715 Link Here
709
    ldns_pkt *pkt;
838
    ldns_pkt *pkt;
710
    bool q;
839
    bool q;
711
840
712
    q = query(res, domain, &pkt);
841
    q = query(res, domain, &pkt, true);
713
    report(res, domain, pkt);
842
    report(res, domain, pkt);
714
    return q;
843
    return q;
715
}
844
}
Lines 719-725 Link Here
719
    ldns_pkt *pkt;
848
    ldns_pkt *pkt;
720
    bool q;
849
    bool q;
721
850
722
    q = query(res, domain, &pkt);
851
    q = query(res, domain, &pkt, true);
723
    ldns_pkt_filter_answer(pkt, o_rrtype);
852
    ldns_pkt_filter_answer(pkt, o_rrtype);
724
    report(res, domain, pkt);
853
    report(res, domain, pkt);
725
    return q;
854
    return q;
Lines 730-736 Link Here
730
    ldns_pkt *pkt;
859
    ldns_pkt *pkt;
731
    ldns_rdf *dname;
860
    ldns_rdf *dname;
732
861
733
    dname = search(res, domain, &pkt, absolute);
862
    dname = search(res, domain, &pkt, absolute, true);
734
    report(res, dname != NULL ? dname : domain, pkt);
863
    report(res, dname != NULL ? dname : domain, pkt);
735
    return o_mode != M_DEFAULT_Q ? (dname != NULL) :
864
    return o_mode != M_DEFAULT_Q ? (dname != NULL) :
736
        (dname != NULL) &&
865
        (dname != NULL) &&
Lines 739-755 Link Here
739
}
868
}
740
869
741
static bool
870
static bool
742
doaxfr(ldns_resolver *res, ldns_rdf *domain, bool absolute) {
871
dozonetransfer(ldns_resolver *res, ldns_rdf *domain, bool absolute) {
743
    ldns_pkt *pkt;
872
    ldns_pkt *pkt, *nextpkt;
744
    ldns_rdf *dname;
873
    ldns_rdf *dname;
745
    ldns_rr_type rrtype;
874
    ldns_rr_type rrtype;
875
    ldns_rr_list *rrl;
876
    int i, nsoa = 0;
746
877
747
    rrtype = o_rrtype;
878
    rrtype = o_rrtype;
748
    o_rrtype = LDNS_RR_TYPE_AXFR;
879
    o_rrtype = (o_mode == M_AXFR) ? LDNS_RR_TYPE_AXFR : LDNS_RR_TYPE_IXFR;
749
    dname = search(res, domain, &pkt, absolute);
880
    dname = search(res, domain, &pkt, absolute, false);
750
    ldns_pkt_filter_answer(pkt, rrtype);
881
751
    report(res, dname != NULL ? dname : domain, pkt);
882
    for (;;) {
752
    return dname != NULL;
883
        rrl = ldns_pkt_answer(pkt);
884
        for (i = ldns_rr_list_rr_count(rrl) - 1; i >= 0; i--) {
885
            if (ldns_rr_get_type(ldns_rr_list_rr(rrl, i)) == LDNS_RR_TYPE_SOA)
886
                nsoa++;
887
        }
888
        ldns_pkt_filter_answer(pkt, rrtype);
889
        report(res, dname != NULL ? dname : domain, pkt);
890
        if ((dname == NULL) ||
891
                (ldns_pkt_get_rcode(pkt) != LDNS_RCODE_NOERROR)) {
892
            printf("; Transfer failed.\n");
893
            ldns_tcp_close(res);
894
            return false;
895
        }
896
        if (nsoa >= 2) {
897
            ldns_tcp_close(res);
898
            return true;
899
        }
900
        if (ldns_tcp_read(&nextpkt, res) != LDNS_STATUS_OK) {
901
            printf("; Transfer failed.\n");
902
            return false;
903
        }
904
        ldns_pkt_set_answerfrom(nextpkt,
905
                ldns_rdf_clone(ldns_pkt_answerfrom(pkt)));
906
        ldns_pkt_free(pkt);
907
        pkt = nextpkt;
908
    }
753
}
909
}
754
910
755
static bool
911
static bool
Lines 760-766 Link Here
760
    ldns_rr *rr;
916
    ldns_rr *rr;
761
    size_t i, j, n, cnt;
917
    size_t i, j, n, cnt;
762
918
763
    if ((dname = search(res, domain, &pkt, absolute)) == NULL)
919
    if ((dname = search(res, domain, &pkt, absolute, true)) == NULL)
764
        return false;
920
        return false;
765
921
766
    answer = ldns_pkt_answer(pkt);
922
    answer = ldns_pkt_answer(pkt);
Lines 780-788 Link Here
780
            ldns_resolver_remove_nameservers(res);
936
            ldns_resolver_remove_nameservers(res);
781
            rr = ldns_rr_list_rr(nsaddrs[i], j);
937
            rr = ldns_rr_list_rr(nsaddrs[i], j);
782
            if ((ldns_resolver_ip6(res) == LDNS_RESOLV_INET &&
938
            if ((ldns_resolver_ip6(res) == LDNS_RESOLV_INET &&
783
		    ldns_rr_get_type(rr) == LDNS_RR_TYPE_AAAA) ||
939
                ldns_rr_get_type(rr) == LDNS_RR_TYPE_AAAA) ||
784
                (ldns_resolver_ip6(res) == LDNS_RESOLV_INET6 &&
940
                (ldns_resolver_ip6(res) == LDNS_RESOLV_INET6 &&
785
		    ldns_rr_get_type(rr) == LDNS_RR_TYPE_A))
941
                ldns_rr_get_type(rr) == LDNS_RR_TYPE_A))
786
                continue;
942
                continue;
787
            if (ldns_resolver_push_nameserver_rr(res, rr) == LDNS_STATUS_OK)
943
            if (ldns_resolver_push_nameserver_rr(res, rr) == LDNS_STATUS_OK)
788
                /* bind9-host queries for domain, not dname here */
944
                /* bind9-host queries for domain, not dname here */
Lines 879-884 Link Here
879
        o_rrtype = LDNS_RR_TYPE_PTR;
1035
        o_rrtype = LDNS_RR_TYPE_PTR;
880
        return !doquery(res, dname);
1036
        return !doquery(res, dname);
881
    }
1037
    }
882
    return !(o_mode == M_SOA ? dosoa : o_mode == M_AXFR ? doaxfr : dosearch)
1038
    return !(o_mode == M_SOA ? dosoa :
1039
             o_mode == M_AXFR ? dozonetransfer :
1040
             o_mode == M_IXFR ? dozonetransfer :
1041
             dosearch)
883
        (res, safe_str2rdf_dname(o_name), ndots(o_name) >= o_ndots);
1042
        (res, safe_str2rdf_dname(o_name), ndots(o_name) >= o_ndots);
884
}
1043
}

Return to bug 209177