diff options
Diffstat (limited to 'lib/dns/rdata/generic/ptr_12.c')
-rw-r--r-- | lib/dns/rdata/generic/ptr_12.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/lib/dns/rdata/generic/ptr_12.c b/lib/dns/rdata/generic/ptr_12.c index a619f137a877f..e3f65cf28561a 100644 --- a/lib/dns/rdata/generic/ptr_12.c +++ b/lib/dns/rdata/generic/ptr_12.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2007, 2009, 2015 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -30,7 +30,7 @@ fromtext_ptr(ARGS_FROMTEXT) { dns_name_t name; isc_buffer_t buffer; - REQUIRE(type == 12); + REQUIRE(type == dns_rdatatype_ptr); UNUSED(type); UNUSED(rdclass); @@ -63,7 +63,7 @@ totext_ptr(ARGS_TOTEXT) { dns_name_t prefix; isc_boolean_t sub; - REQUIRE(rdata->type == 12); + REQUIRE(rdata->type == dns_rdatatype_ptr); REQUIRE(rdata->length != 0); dns_name_init(&name, NULL); @@ -81,7 +81,7 @@ static inline isc_result_t fromwire_ptr(ARGS_FROMWIRE) { dns_name_t name; - REQUIRE(type == 12); + REQUIRE(type == dns_rdatatype_ptr); UNUSED(type); UNUSED(rdclass); @@ -98,7 +98,7 @@ towire_ptr(ARGS_TOWIRE) { dns_offsets_t offsets; isc_region_t region; - REQUIRE(rdata->type == 12); + REQUIRE(rdata->type == dns_rdatatype_ptr); REQUIRE(rdata->length != 0); dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); @@ -119,7 +119,7 @@ compare_ptr(ARGS_COMPARE) { REQUIRE(rdata1->type == rdata2->type); REQUIRE(rdata1->rdclass == rdata2->rdclass); - REQUIRE(rdata1->type == 12); + REQUIRE(rdata1->type == dns_rdatatype_ptr); REQUIRE(rdata1->length != 0); REQUIRE(rdata2->length != 0); @@ -140,7 +140,7 @@ fromstruct_ptr(ARGS_FROMSTRUCT) { dns_rdata_ptr_t *ptr = source; isc_region_t region; - REQUIRE(type == 12); + REQUIRE(type == dns_rdatatype_ptr); REQUIRE(source != NULL); REQUIRE(ptr->common.rdtype == type); REQUIRE(ptr->common.rdclass == rdclass); @@ -158,7 +158,7 @@ tostruct_ptr(ARGS_TOSTRUCT) { dns_rdata_ptr_t *ptr = target; dns_name_t name; - REQUIRE(rdata->type == 12); + REQUIRE(rdata->type == dns_rdatatype_ptr); REQUIRE(target != NULL); REQUIRE(rdata->length != 0); @@ -180,7 +180,7 @@ freestruct_ptr(ARGS_FREESTRUCT) { dns_rdata_ptr_t *ptr = source; REQUIRE(source != NULL); - REQUIRE(ptr->common.rdtype == 12); + REQUIRE(ptr->common.rdtype == dns_rdatatype_ptr); if (ptr->mctx == NULL) return; @@ -191,7 +191,7 @@ freestruct_ptr(ARGS_FREESTRUCT) { static inline isc_result_t additionaldata_ptr(ARGS_ADDLDATA) { - REQUIRE(rdata->type == 12); + REQUIRE(rdata->type == dns_rdatatype_ptr); UNUSED(rdata); UNUSED(add); @@ -205,7 +205,7 @@ digest_ptr(ARGS_DIGEST) { isc_region_t r; dns_name_t name; - REQUIRE(rdata->type == 12); + REQUIRE(rdata->type == dns_rdatatype_ptr); dns_rdata_toregion(rdata, &r); dns_name_init(&name, NULL); @@ -217,7 +217,7 @@ digest_ptr(ARGS_DIGEST) { static inline isc_boolean_t checkowner_ptr(ARGS_CHECKOWNER) { - REQUIRE(type == 12); + REQUIRE(type == dns_rdatatype_ptr); UNUSED(name); UNUSED(type); @@ -268,11 +268,14 @@ checknames_ptr(ARGS_CHECKNAMES) { isc_region_t region; dns_name_t name; - REQUIRE(rdata->type == 12); + REQUIRE(rdata->type == dns_rdatatype_ptr); if (rdata->rdclass != dns_rdataclass_in) return (ISC_TRUE); + if (dns_name_isdnssd(owner)) + return (ISC_TRUE); + if (dns_name_issubdomain(owner, &in_addr_arpa) || dns_name_issubdomain(owner, &ip6_arpa) || dns_name_issubdomain(owner, &ip6_int)) { |