mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
replace dns_slabheader_raw() with a flexible array member
we can use header->raw instead of dns_slabheader_raw().
This commit is contained in:
parent
712ef31a0c
commit
727fb9a011
@ -143,6 +143,12 @@ struct dns_slabheader {
|
|||||||
* rendering that character upper case.
|
* rendering that character upper case.
|
||||||
*/
|
*/
|
||||||
unsigned char upper[32];
|
unsigned char upper[32];
|
||||||
|
|
||||||
|
/*%
|
||||||
|
* Flexible member indicates the address of the raw data
|
||||||
|
* following this header.
|
||||||
|
*/
|
||||||
|
unsigned char raw[];
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
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.
|
*\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
|
void
|
||||||
dns_slabheader_setownercase(dns_slabheader_t *header, const dns_name_t *name);
|
dns_slabheader_setownercase(dns_slabheader_t *header, const dns_name_t *name);
|
||||||
/*%<
|
/*%<
|
||||||
|
@ -1072,7 +1072,7 @@ bindrdataset(qpcache_t *qpdb, qpcnode_t *node, dns_slabheader_t *header,
|
|||||||
|
|
||||||
rdataset->slab.db = (dns_db_t *)qpdb;
|
rdataset->slab.db = (dns_db_t *)qpdb;
|
||||||
rdataset->slab.node = (dns_dbnode_t *)node;
|
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_pos = NULL;
|
||||||
rdataset->slab.iter_count = 0;
|
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 = isc_mem_get(mctx, sizeof(*noqname));
|
||||||
*noqname = (dns_slabheader_proof_t){
|
*noqname = (dns_slabheader_proof_t){
|
||||||
.neg = dns_slabheader_raw((dns_slabheader_t *)r1.base),
|
.neg = ((dns_slabheader_t *)r1.base)->raw,
|
||||||
.negsig = dns_slabheader_raw((dns_slabheader_t *)r2.base),
|
.negsig = ((dns_slabheader_t *)r2.base)->raw,
|
||||||
.type = neg.type,
|
.type = neg.type,
|
||||||
.name = DNS_NAME_INITEMPTY,
|
.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 = isc_mem_get(mctx, sizeof(*closest));
|
||||||
*closest = (dns_slabheader_proof_t){
|
*closest = (dns_slabheader_proof_t){
|
||||||
.neg = dns_slabheader_raw((dns_slabheader_t *)r1.base),
|
.neg = ((dns_slabheader_t *)r1.base)->raw,
|
||||||
.negsig = dns_slabheader_raw((dns_slabheader_t *)r2.base),
|
.negsig = ((dns_slabheader_t *)r2.base)->raw,
|
||||||
.name = DNS_NAME_INITEMPTY,
|
.name = DNS_NAME_INITEMPTY,
|
||||||
.type = neg.type,
|
.type = neg.type,
|
||||||
};
|
};
|
||||||
|
@ -1042,7 +1042,7 @@ bindrdataset(qpzonedb_t *qpdb, qpznode_t *node, dns_slabheader_t *header,
|
|||||||
|
|
||||||
rdataset->slab.db = (dns_db_t *)qpdb;
|
rdataset->slab.db = (dns_db_t *)qpdb;
|
||||||
rdataset->slab.node = (dns_dbnode_t *)node;
|
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_pos = NULL;
|
||||||
rdataset->slab.iter_count = 0;
|
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.
|
* Find an NSEC3PARAM with a supported algorithm.
|
||||||
*/
|
*/
|
||||||
raw = dns_slabheader_raw(found);
|
raw = found->raw;
|
||||||
count = get_uint16(raw);
|
count = get_uint16(raw);
|
||||||
while (count-- > 0U) {
|
while (count-- > 0U) {
|
||||||
dns_rdata_t rdata = DNS_RDATA_INIT;
|
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||||
|
@ -800,11 +800,6 @@ dns_rdataslab_equalx(dns_slabheader_t *slab1, dns_slabheader_t *slab2,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
|
||||||
dns_slabheader_raw(dns_slabheader_t *header) {
|
|
||||||
return header + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
dns_slabheader_setownercase(dns_slabheader_t *header, const dns_name_t *name) {
|
dns_slabheader_setownercase(dns_slabheader_t *header, const dns_name_t *name) {
|
||||||
REQUIRE(!CASESET(header));
|
REQUIRE(!CASESET(header));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user