diff --git a/lib/dns/include/dns/rdataslab.h b/lib/dns/include/dns/rdataslab.h index 45bff01d1a..a292b4acd3 100644 --- a/lib/dns/include/dns/rdataslab.h +++ b/lib/dns/include/dns/rdataslab.h @@ -143,6 +143,12 @@ struct dns_slabheader { * rendering that character upper case. */ unsigned char upper[32]; + + /*% + * Flexible member indicates the address of the raw data + * following this header. + */ + unsigned char raw[]; }; enum { @@ -278,12 +284,6 @@ dns_rdataslab_equalx(dns_slabheader_t *header1, dns_slabheader_t *header2, *\li true if the slabs are equal, #false otherwise. */ -void * -dns_slabheader_raw(dns_slabheader_t *header); -/*% - * Returns the address of the raw memory following a dns_slabheader. - */ - void dns_slabheader_setownercase(dns_slabheader_t *header, const dns_name_t *name); /*%< diff --git a/lib/dns/qpcache.c b/lib/dns/qpcache.c index 7613105123..db285441c4 100644 --- a/lib/dns/qpcache.c +++ b/lib/dns/qpcache.c @@ -1072,7 +1072,7 @@ bindrdataset(qpcache_t *qpdb, qpcnode_t *node, dns_slabheader_t *header, rdataset->slab.db = (dns_db_t *)qpdb; rdataset->slab.node = (dns_dbnode_t *)node; - rdataset->slab.raw = dns_slabheader_raw(header); + rdataset->slab.raw = header->raw; rdataset->slab.iter_pos = NULL; rdataset->slab.iter_count = 0; @@ -2913,8 +2913,8 @@ addnoqname(isc_mem_t *mctx, dns_slabheader_t *newheader, uint32_t maxrrperset, noqname = isc_mem_get(mctx, sizeof(*noqname)); *noqname = (dns_slabheader_proof_t){ - .neg = dns_slabheader_raw((dns_slabheader_t *)r1.base), - .negsig = dns_slabheader_raw((dns_slabheader_t *)r2.base), + .neg = ((dns_slabheader_t *)r1.base)->raw, + .negsig = ((dns_slabheader_t *)r2.base)->raw, .type = neg.type, .name = DNS_NAME_INITEMPTY, }; @@ -2952,8 +2952,8 @@ addclosest(isc_mem_t *mctx, dns_slabheader_t *newheader, uint32_t maxrrperset, closest = isc_mem_get(mctx, sizeof(*closest)); *closest = (dns_slabheader_proof_t){ - .neg = dns_slabheader_raw((dns_slabheader_t *)r1.base), - .negsig = dns_slabheader_raw((dns_slabheader_t *)r2.base), + .neg = ((dns_slabheader_t *)r1.base)->raw, + .negsig = ((dns_slabheader_t *)r2.base)->raw, .name = DNS_NAME_INITEMPTY, .type = neg.type, }; diff --git a/lib/dns/qpzone.c b/lib/dns/qpzone.c index 3f2124546b..16f67d3ded 100644 --- a/lib/dns/qpzone.c +++ b/lib/dns/qpzone.c @@ -1042,7 +1042,7 @@ bindrdataset(qpzonedb_t *qpdb, qpznode_t *node, dns_slabheader_t *header, rdataset->slab.db = (dns_db_t *)qpdb; rdataset->slab.node = (dns_dbnode_t *)node; - rdataset->slab.raw = dns_slabheader_raw(header); + rdataset->slab.raw = header->raw; rdataset->slab.iter_pos = NULL; rdataset->slab.iter_count = 0; @@ -1110,7 +1110,7 @@ setnsec3parameters(dns_db_t *db, qpz_version_t *version) { /* * Find an NSEC3PARAM with a supported algorithm. */ - raw = dns_slabheader_raw(found); + raw = found->raw; count = get_uint16(raw); while (count-- > 0U) { dns_rdata_t rdata = DNS_RDATA_INIT; diff --git a/lib/dns/rdataslab.c b/lib/dns/rdataslab.c index 48fd9962d1..2297418665 100644 --- a/lib/dns/rdataslab.c +++ b/lib/dns/rdataslab.c @@ -800,11 +800,6 @@ dns_rdataslab_equalx(dns_slabheader_t *slab1, dns_slabheader_t *slab2, return true; } -void * -dns_slabheader_raw(dns_slabheader_t *header) { - return header + 1; -} - void dns_slabheader_setownercase(dns_slabheader_t *header, const dns_name_t *name) { REQUIRE(!CASESET(header));