2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

[9.20] fix: dev: Use DNS_RDATACOMMON_INIT to hide branch differences

Initialization of the common members of rdata type structures varies across branches. Standardize it by using the `DNS_RDATACOMMON_INIT` macro for all types, so that new types are more likely to use it, and hence backport more cleanly.

Closes #5467

Merge branch '5467-use-dns_rdatacommon_init-to-hide-branch-differences-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!10834
This commit is contained in:
Mark Andrews 2025-08-15 06:59:05 +10:00
commit a64df9729b
85 changed files with 85 additions and 255 deletions

View File

@ -454,9 +454,7 @@ tostruct_any_tsig(ARGS_TOSTRUCT) {
REQUIRE(rdata->length != 0);
tsig = (dns_rdata_any_tsig_t *)target;
tsig->common.rdclass = rdata->rdclass;
tsig->common.rdtype = rdata->type;
ISC_LINK_INIT(&tsig->common, link);
DNS_RDATACOMMON_INIT(tsig, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &sr);

View File

@ -226,9 +226,7 @@ tostruct_ch_a(ARGS_TOSTRUCT) {
REQUIRE(rdata->rdclass == dns_rdataclass_ch);
REQUIRE(rdata->length != 0);
a->common.rdclass = rdata->rdclass;
a->common.rdtype = rdata->type;
ISC_LINK_INIT(&a->common, link);
DNS_RDATACOMMON_INIT(a, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);

View File

@ -207,9 +207,7 @@ tostruct_afsdb(ARGS_TOSTRUCT) {
REQUIRE(afsdb != NULL);
REQUIRE(rdata->length != 0);
afsdb->common.rdclass = rdata->rdclass;
afsdb->common.rdtype = rdata->type;
ISC_LINK_INIT(&afsdb->common, link);
DNS_RDATACOMMON_INIT(afsdb, rdata->type, rdata->rdclass);
dns_name_init(&afsdb->server, NULL);

View File

@ -314,9 +314,7 @@ tostruct_amtrelay(ARGS_TOSTRUCT) {
REQUIRE(amtrelay != NULL);
REQUIRE(rdata->length >= 2);
amtrelay->common.rdclass = rdata->rdclass;
amtrelay->common.rdtype = rdata->type;
ISC_LINK_INIT(&amtrelay->common, link);
DNS_RDATACOMMON_INIT(amtrelay, rdata->type, rdata->rdclass);
dns_name_init(&amtrelay->gateway, NULL);
amtrelay->data = NULL;

View File

@ -75,9 +75,7 @@ tostruct_avc(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == dns_rdatatype_avc);
REQUIRE(avc != NULL);
avc->common.rdclass = rdata->rdclass;
avc->common.rdtype = rdata->type;
ISC_LINK_INIT(&avc->common, link);
DNS_RDATACOMMON_INIT(avc, rdata->type, rdata->rdclass);
return generic_tostruct_txt(CALL_TOSTRUCT);
}

View File

@ -498,9 +498,7 @@ tostruct_caa(ARGS_TOSTRUCT) {
REQUIRE(rdata->length >= 3U);
REQUIRE(rdata->data != NULL);
caa->common.rdclass = rdata->rdclass;
caa->common.rdtype = rdata->type;
ISC_LINK_INIT(&caa->common, link);
DNS_RDATACOMMON_INIT(caa, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &sr);

View File

@ -88,9 +88,7 @@ tostruct_cdnskey(ARGS_TOSTRUCT) {
REQUIRE(rdata != NULL);
REQUIRE(rdata->type == dns_rdatatype_cdnskey);
dnskey->common.rdclass = rdata->rdclass;
dnskey->common.rdtype = rdata->type;
ISC_LINK_INIT(&dnskey->common, link);
DNS_RDATACOMMON_INIT(dnskey, rdata->type, rdata->rdclass);
return generic_tostruct_key(CALL_TOSTRUCT);
}

View File

@ -89,9 +89,7 @@ tostruct_cds(ARGS_TOSTRUCT) {
/*
* Checked by generic_tostruct_ds().
*/
cds->common.rdclass = rdata->rdclass;
cds->common.rdtype = rdata->type;
ISC_LINK_INIT(&cds->common, link);
DNS_RDATACOMMON_INIT(cds, rdata->type, rdata->rdclass);
return generic_tostruct_ds(CALL_TOSTRUCT);
}

View File

@ -191,9 +191,7 @@ tostruct_cert(ARGS_TOSTRUCT) {
REQUIRE(cert != NULL);
REQUIRE(rdata->length != 0);
cert->common.rdclass = rdata->rdclass;
cert->common.rdtype = rdata->type;
ISC_LINK_INIT(&cert->common, link);
DNS_RDATACOMMON_INIT(cert, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);

View File

@ -147,9 +147,7 @@ tostruct_cname(ARGS_TOSTRUCT) {
REQUIRE(cname != NULL);
REQUIRE(rdata->length != 0);
cname->common.rdclass = rdata->rdclass;
cname->common.rdtype = rdata->type;
ISC_LINK_INIT(&cname->common, link);
DNS_RDATACOMMON_INIT(cname, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -168,9 +168,7 @@ tostruct_csync(ARGS_TOSTRUCT) {
REQUIRE(csync != NULL);
REQUIRE(rdata->length != 0);
csync->common.rdclass = rdata->rdclass;
csync->common.rdtype = rdata->type;
ISC_LINK_INIT(&csync->common, link);
DNS_RDATACOMMON_INIT(csync, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);

View File

@ -85,9 +85,7 @@ tostruct_dlv(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == dns_rdatatype_dlv);
REQUIRE(dlv != NULL);
dlv->common.rdclass = rdata->rdclass;
dlv->common.rdtype = rdata->type;
ISC_LINK_INIT(&dlv->common, link);
DNS_RDATACOMMON_INIT(dlv, rdata->type, rdata->rdclass);
return generic_tostruct_ds(CALL_TOSTRUCT);
}

View File

@ -147,9 +147,7 @@ tostruct_dname(ARGS_TOSTRUCT) {
REQUIRE(dname != NULL);
REQUIRE(rdata->length != 0);
dname->common.rdclass = rdata->rdclass;
dname->common.rdtype = rdata->type;
ISC_LINK_INIT(&dname->common, link);
DNS_RDATACOMMON_INIT(dname, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -89,9 +89,7 @@ tostruct_dnskey(ARGS_TOSTRUCT) {
REQUIRE(rdata != NULL);
REQUIRE(rdata->type == dns_rdatatype_dnskey);
dnskey->common.rdclass = rdata->rdclass;
dnskey->common.rdtype = rdata->type;
ISC_LINK_INIT(&dnskey->common, link);
DNS_RDATACOMMON_INIT(dnskey, rdata->type, rdata->rdclass);
return generic_tostruct_key(CALL_TOSTRUCT);
}

View File

@ -214,9 +214,7 @@ tostruct_doa(ARGS_TOSTRUCT) {
REQUIRE(doa != NULL);
REQUIRE(rdata->length >= 10);
doa->common.rdclass = rdata->rdclass;
doa->common.rdtype = rdata->type;
ISC_LINK_INIT(&doa->common, link);
DNS_RDATACOMMON_INIT(doa, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);

View File

@ -303,9 +303,7 @@ tostruct_ds(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == dns_rdatatype_ds);
REQUIRE(ds != NULL);
ds->common.rdclass = rdata->rdclass;
ds->common.rdtype = rdata->type;
ISC_LINK_INIT(&ds->common, link);
DNS_RDATACOMMON_INIT(ds, rdata->type, rdata->rdclass);
return generic_tostruct_ds(CALL_TOSTRUCT);
}

View File

@ -253,9 +253,7 @@ tostruct_dsync(ARGS_TOSTRUCT) {
REQUIRE(dsync != NULL);
REQUIRE(rdata->length != 0);
dsync->common.rdclass = rdata->rdclass;
dsync->common.rdtype = rdata->type;
ISC_LINK_INIT(&dsync->common, link);
DNS_RDATACOMMON_INIT(dsync, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -136,9 +136,7 @@ tostruct_eui48(ARGS_TOSTRUCT) {
UNUSED(mctx);
eui48->common.rdclass = rdata->rdclass;
eui48->common.rdtype = rdata->type;
ISC_LINK_INIT(&eui48->common, link);
DNS_RDATACOMMON_INIT(eui48, rdata->type, rdata->rdclass);
memmove(eui48->eui48, rdata->data, rdata->length);
return ISC_R_SUCCESS;

View File

@ -139,9 +139,7 @@ tostruct_eui64(ARGS_TOSTRUCT) {
UNUSED(mctx);
eui64->common.rdclass = rdata->rdclass;
eui64->common.rdtype = rdata->type;
ISC_LINK_INIT(&eui64->common, link);
DNS_RDATACOMMON_INIT(eui64, rdata->type, rdata->rdclass);
memmove(eui64->eui64, rdata->data, rdata->length);
return ISC_R_SUCCESS;

View File

@ -132,9 +132,7 @@ tostruct_gpos(ARGS_TOSTRUCT) {
REQUIRE(gpos != NULL);
REQUIRE(rdata->length != 0);
gpos->common.rdclass = rdata->rdclass;
gpos->common.rdtype = rdata->type;
ISC_LINK_INIT(&gpos->common, link);
DNS_RDATACOMMON_INIT(gpos, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);
gpos->long_len = uint8_fromregion(&region);

View File

@ -116,9 +116,7 @@ tostruct_hinfo(ARGS_TOSTRUCT) {
REQUIRE(hinfo != NULL);
REQUIRE(rdata->length != 0);
hinfo->common.rdclass = rdata->rdclass;
hinfo->common.rdtype = rdata->type;
ISC_LINK_INIT(&hinfo->common, link);
DNS_RDATACOMMON_INIT(hinfo, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);
hinfo->cpu_len = uint8_fromregion(&region);

View File

@ -306,9 +306,7 @@ tostruct_hip(ARGS_TOSTRUCT) {
REQUIRE(hip != NULL);
REQUIRE(rdata->length != 0);
hip->common.rdclass = rdata->rdclass;
hip->common.rdtype = rdata->type;
ISC_LINK_INIT(&hip->common, link);
DNS_RDATACOMMON_INIT(hip, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);

View File

@ -353,9 +353,7 @@ tostruct_ipseckey(ARGS_TOSTRUCT) {
REQUIRE(ipseckey != NULL);
REQUIRE(rdata->length >= 3);
ipseckey->common.rdclass = rdata->rdclass;
ipseckey->common.rdtype = rdata->type;
ISC_LINK_INIT(&ipseckey->common, link);
DNS_RDATACOMMON_INIT(ipseckey, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -137,9 +137,7 @@ tostruct_isdn(ARGS_TOSTRUCT) {
REQUIRE(isdn != NULL);
REQUIRE(rdata->length != 0);
isdn->common.rdclass = rdata->rdclass;
isdn->common.rdtype = rdata->type;
ISC_LINK_INIT(&isdn->common, link);
DNS_RDATACOMMON_INIT(isdn, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &r);

View File

@ -415,9 +415,7 @@ tostruct_key(ARGS_TOSTRUCT) {
REQUIRE(rdata != NULL);
REQUIRE(rdata->type == dns_rdatatype_key);
key->common.rdclass = rdata->rdclass;
key->common.rdtype = rdata->type;
ISC_LINK_INIT(&key->common, link);
DNS_RDATACOMMON_INIT(key, rdata->type, rdata->rdclass);
return generic_tostruct_key(CALL_TOSTRUCT);
}

View File

@ -330,9 +330,7 @@ tostruct_keydata(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == dns_rdatatype_keydata);
REQUIRE(keydata != NULL);
keydata->common.rdclass = rdata->rdclass;
keydata->common.rdtype = rdata->type;
ISC_LINK_INIT(&keydata->common, link);
DNS_RDATACOMMON_INIT(keydata, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &sr);

View File

@ -152,9 +152,7 @@ tostruct_l32(ARGS_TOSTRUCT) {
UNUSED(mctx);
l32->common.rdclass = rdata->rdclass;
l32->common.rdtype = rdata->type;
ISC_LINK_INIT(&l32->common, link);
DNS_RDATACOMMON_INIT(l32, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);
l32->pref = uint16_fromregion(&region);

View File

@ -147,9 +147,7 @@ tostruct_l64(ARGS_TOSTRUCT) {
UNUSED(mctx);
l64->common.rdclass = rdata->rdclass;
l64->common.rdtype = rdata->type;
ISC_LINK_INIT(&l64->common, link);
DNS_RDATACOMMON_INIT(l64, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);
l64->pref = uint16_fromregion(&region);

View File

@ -752,9 +752,7 @@ tostruct_loc(ARGS_TOSTRUCT) {
return ISC_R_NOTIMPLEMENTED;
}
loc->common.rdclass = rdata->rdclass;
loc->common.rdtype = rdata->type;
ISC_LINK_INIT(&loc->common, link);
DNS_RDATACOMMON_INIT(loc, rdata->type, rdata->rdclass);
loc->v.v0.version = version;
isc_region_consume(&r, 1);

View File

@ -157,9 +157,7 @@ tostruct_lp(ARGS_TOSTRUCT) {
REQUIRE(lp != NULL);
REQUIRE(rdata->length != 0);
lp->common.rdclass = rdata->rdclass;
lp->common.rdtype = rdata->type;
ISC_LINK_INIT(&lp->common, link);
DNS_RDATACOMMON_INIT(lp, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -146,9 +146,7 @@ tostruct_mb(ARGS_TOSTRUCT) {
REQUIRE(mb != NULL);
REQUIRE(rdata->length != 0);
mb->common.rdclass = rdata->rdclass;
mb->common.rdtype = rdata->type;
ISC_LINK_INIT(&mb->common, link);
DNS_RDATACOMMON_INIT(mb, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -146,9 +146,7 @@ tostruct_md(ARGS_TOSTRUCT) {
REQUIRE(md != NULL);
REQUIRE(rdata->length != 0);
md->common.rdclass = rdata->rdclass;
md->common.rdtype = rdata->type;
ISC_LINK_INIT(&md->common, link);
DNS_RDATACOMMON_INIT(md, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &r);

View File

@ -146,9 +146,7 @@ tostruct_mf(ARGS_TOSTRUCT) {
REQUIRE(mf != NULL);
REQUIRE(rdata->length != 0);
mf->common.rdclass = rdata->rdclass;
mf->common.rdtype = rdata->type;
ISC_LINK_INIT(&mf->common, link);
DNS_RDATACOMMON_INIT(mf, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &r);

View File

@ -146,9 +146,7 @@ tostruct_mg(ARGS_TOSTRUCT) {
REQUIRE(mg != NULL);
REQUIRE(rdata->length != 0);
mg->common.rdclass = rdata->rdclass;
mg->common.rdtype = rdata->type;
ISC_LINK_INIT(&mg->common, link);
DNS_RDATACOMMON_INIT(mg, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -209,9 +209,7 @@ tostruct_minfo(ARGS_TOSTRUCT) {
REQUIRE(minfo != NULL);
REQUIRE(rdata->length != 0);
minfo->common.rdclass = rdata->rdclass;
minfo->common.rdtype = rdata->type;
ISC_LINK_INIT(&minfo->common, link);
DNS_RDATACOMMON_INIT(minfo, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -146,9 +146,7 @@ tostruct_mr(ARGS_TOSTRUCT) {
REQUIRE(mr != NULL);
REQUIRE(rdata->length != 0);
mr->common.rdclass = rdata->rdclass;
mr->common.rdtype = rdata->type;
ISC_LINK_INIT(&mr->common, link);
DNS_RDATACOMMON_INIT(mr, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -231,9 +231,7 @@ tostruct_mx(ARGS_TOSTRUCT) {
REQUIRE(mx != NULL);
REQUIRE(rdata->length != 0);
mx->common.rdclass = rdata->rdclass;
mx->common.rdtype = rdata->type;
ISC_LINK_INIT(&mx->common, link);
DNS_RDATACOMMON_INIT(mx, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -502,9 +502,7 @@ tostruct_naptr(ARGS_TOSTRUCT) {
REQUIRE(naptr != NULL);
REQUIRE(rdata->length != 0);
naptr->common.rdclass = rdata->rdclass;
naptr->common.rdtype = rdata->type;
ISC_LINK_INIT(&naptr->common, link);
DNS_RDATACOMMON_INIT(naptr, rdata->type, rdata->rdclass);
naptr->flags = NULL;
naptr->service = NULL;

View File

@ -147,9 +147,7 @@ tostruct_nid(ARGS_TOSTRUCT) {
UNUSED(mctx);
nid->common.rdclass = rdata->rdclass;
nid->common.rdtype = rdata->type;
ISC_LINK_INIT(&nid->common, link);
DNS_RDATACOMMON_INIT(nid, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);
nid->pref = uint16_fromregion(&region);

View File

@ -75,9 +75,7 @@ tostruct_ninfo(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == dns_rdatatype_ninfo);
REQUIRE(ninfo != NULL);
ninfo->common.rdclass = rdata->rdclass;
ninfo->common.rdtype = rdata->type;
ISC_LINK_INIT(&ninfo->common, link);
DNS_RDATACOMMON_INIT(ninfo, rdata->type, rdata->rdclass);
return generic_tostruct_txt(CALL_TOSTRUCT);
}

View File

@ -157,9 +157,7 @@ tostruct_ns(ARGS_TOSTRUCT) {
REQUIRE(ns != NULL);
REQUIRE(rdata->length != 0);
ns->common.rdclass = rdata->rdclass;
ns->common.rdtype = rdata->type;
ISC_LINK_INIT(&ns->common, link);
DNS_RDATACOMMON_INIT(ns, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -292,9 +292,7 @@ tostruct_nsec3(ARGS_TOSTRUCT) {
REQUIRE(nsec3 != NULL);
REQUIRE(rdata->length != 0);
nsec3->common.rdclass = rdata->rdclass;
nsec3->common.rdtype = rdata->type;
ISC_LINK_INIT(&nsec3->common, link);
DNS_RDATACOMMON_INIT(nsec3, rdata->type, rdata->rdclass);
region.base = rdata->data;
region.length = rdata->length;

View File

@ -228,9 +228,7 @@ tostruct_nsec3param(ARGS_TOSTRUCT) {
REQUIRE(nsec3param != NULL);
REQUIRE(rdata->length != 0);
nsec3param->common.rdclass = rdata->rdclass;
nsec3param->common.rdtype = rdata->type;
ISC_LINK_INIT(&nsec3param->common, link);
DNS_RDATACOMMON_INIT(nsec3param, rdata->type, rdata->rdclass);
region.base = rdata->data;
region.length = rdata->length;

View File

@ -165,9 +165,7 @@ tostruct_nsec(ARGS_TOSTRUCT) {
REQUIRE(nsec != NULL);
REQUIRE(rdata->length != 0);
nsec->common.rdclass = rdata->rdclass;
nsec->common.rdtype = rdata->type;
ISC_LINK_INIT(&nsec->common, link);
DNS_RDATACOMMON_INIT(nsec, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -100,9 +100,7 @@ tostruct_null(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == dns_rdatatype_null);
REQUIRE(null != NULL);
null->common.rdclass = rdata->rdclass;
null->common.rdtype = rdata->type;
ISC_LINK_INIT(&null->common, link);
DNS_RDATACOMMON_INIT(null, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &r);
null->length = r.length;

View File

@ -244,9 +244,7 @@ tostruct_nxt(ARGS_TOSTRUCT) {
REQUIRE(nxt != NULL);
REQUIRE(rdata->length != 0);
nxt->common.rdclass = rdata->rdclass;
nxt->common.rdtype = rdata->type;
ISC_LINK_INIT(&nxt->common, link);
DNS_RDATACOMMON_INIT(nxt, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -144,9 +144,7 @@ tostruct_openpgpkey(ARGS_TOSTRUCT) {
REQUIRE(sig != NULL);
REQUIRE(rdata->length != 0);
sig->common.rdclass = rdata->rdclass;
sig->common.rdtype = rdata->type;
ISC_LINK_INIT(&sig->common, link);
DNS_RDATACOMMON_INIT(sig, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &sr);

View File

@ -328,9 +328,7 @@ tostruct_opt(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == dns_rdatatype_opt);
REQUIRE(opt != NULL);
opt->common.rdclass = rdata->rdclass;
opt->common.rdtype = rdata->type;
ISC_LINK_INIT(&opt->common, link);
DNS_RDATACOMMON_INIT(opt, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &r);
opt->length = r.length;

View File

@ -159,9 +159,7 @@ tostruct_ptr(ARGS_TOSTRUCT) {
REQUIRE(ptr != NULL);
REQUIRE(rdata->length != 0);
ptr->common.rdclass = rdata->rdclass;
ptr->common.rdtype = rdata->type;
ISC_LINK_INIT(&ptr->common, link);
DNS_RDATACOMMON_INIT(ptr, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -76,9 +76,7 @@ tostruct_resinfo(ARGS_TOSTRUCT) {
REQUIRE(rdata != NULL);
REQUIRE(rdata->type == dns_rdatatype_resinfo);
resinfo->common.rdclass = rdata->rdclass;
resinfo->common.rdtype = rdata->type;
ISC_LINK_INIT(&resinfo->common, link);
DNS_RDATACOMMON_INIT(resinfo, rdata->type, rdata->rdclass);
return generic_tostruct_txt(CALL_TOSTRUCT);
}

View File

@ -85,9 +85,7 @@ tostruct_rkey(ARGS_TOSTRUCT) {
REQUIRE(rdata != NULL);
REQUIRE(rdata->type == dns_rdatatype_rkey);
rkey->common.rdclass = rdata->rdclass;
rkey->common.rdtype = rdata->type;
ISC_LINK_INIT(&rkey->common, link);
DNS_RDATACOMMON_INIT(rkey, rdata->type, rdata->rdclass);
return generic_tostruct_key(CALL_TOSTRUCT);
}

View File

@ -209,9 +209,7 @@ tostruct_rp(ARGS_TOSTRUCT) {
REQUIRE(rp != NULL);
REQUIRE(rdata->length != 0);
rp->common.rdclass = rdata->rdclass;
rp->common.rdtype = rdata->type;
ISC_LINK_INIT(&rp->common, link);
DNS_RDATACOMMON_INIT(rp, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -500,9 +500,7 @@ tostruct_rrsig(ARGS_TOSTRUCT) {
REQUIRE(sig != NULL);
REQUIRE(rdata->length != 0);
sig->common.rdclass = rdata->rdclass;
sig->common.rdtype = rdata->type;
ISC_LINK_INIT(&sig->common, link);
DNS_RDATACOMMON_INIT(sig, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &sr);

View File

@ -204,9 +204,7 @@ tostruct_rt(ARGS_TOSTRUCT) {
REQUIRE(rt != NULL);
REQUIRE(rdata->length != 0);
rt->common.rdclass = rdata->rdclass;
rt->common.rdtype = rdata->type;
ISC_LINK_INIT(&rt->common, link);
DNS_RDATACOMMON_INIT(rt, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -464,9 +464,7 @@ tostruct_sig(ARGS_TOSTRUCT) {
REQUIRE(sig != NULL);
REQUIRE(rdata->length != 0);
sig->common.rdclass = rdata->rdclass;
sig->common.rdtype = rdata->type;
ISC_LINK_INIT(&sig->common, link);
DNS_RDATACOMMON_INIT(sig, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &sr);

View File

@ -183,9 +183,7 @@ tostruct_sink(ARGS_TOSTRUCT) {
REQUIRE(sink != NULL);
REQUIRE(rdata->length >= 3);
sink->common.rdclass = rdata->rdclass;
sink->common.rdtype = rdata->type;
ISC_LINK_INIT(&sink->common, link);
DNS_RDATACOMMON_INIT(sink, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &sr);

View File

@ -82,9 +82,7 @@ tostruct_smimea(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == dns_rdatatype_smimea);
REQUIRE(smimea != NULL);
smimea->common.rdclass = rdata->rdclass;
smimea->common.rdtype = rdata->type;
ISC_LINK_INIT(&smimea->common, link);
DNS_RDATACOMMON_INIT(smimea, rdata->type, rdata->rdclass);
return generic_tostruct_tlsa(CALL_TOSTRUCT);
}

View File

@ -313,9 +313,7 @@ tostruct_soa(ARGS_TOSTRUCT) {
REQUIRE(soa != NULL);
REQUIRE(rdata->length != 0);
soa->common.rdclass = rdata->rdclass;
soa->common.rdtype = rdata->type;
ISC_LINK_INIT(&soa->common, link);
DNS_RDATACOMMON_INIT(soa, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);

View File

@ -76,9 +76,7 @@ tostruct_spf(ARGS_TOSTRUCT) {
REQUIRE(rdata != NULL);
REQUIRE(rdata->type == dns_rdatatype_spf);
spf->common.rdclass = rdata->rdclass;
spf->common.rdtype = rdata->type;
ISC_LINK_INIT(&spf->common, link);
DNS_RDATACOMMON_INIT(spf, rdata->type, rdata->rdclass);
return generic_tostruct_txt(CALL_TOSTRUCT);
}

View File

@ -204,9 +204,7 @@ tostruct_sshfp(ARGS_TOSTRUCT) {
REQUIRE(sshfp != NULL);
REQUIRE(rdata->length != 0);
sshfp->common.rdclass = rdata->rdclass;
sshfp->common.rdtype = rdata->type;
ISC_LINK_INIT(&sshfp->common, link);
DNS_RDATACOMMON_INIT(sshfp, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);

View File

@ -85,9 +85,7 @@ tostruct_ta(ARGS_TOSTRUCT) {
/*
* Checked by generic_tostruct_ds().
*/
ds->common.rdclass = rdata->rdclass;
ds->common.rdtype = rdata->type;
ISC_LINK_INIT(&ds->common, link);
DNS_RDATACOMMON_INIT(ds, rdata->type, rdata->rdclass);
return generic_tostruct_ds(CALL_TOSTRUCT);
}

View File

@ -171,9 +171,7 @@ tostruct_talink(ARGS_TOSTRUCT) {
REQUIRE(talink != NULL);
REQUIRE(rdata->length != 0);
talink->common.rdclass = rdata->rdclass;
talink->common.rdtype = rdata->type;
ISC_LINK_INIT(&talink->common, link);
DNS_RDATACOMMON_INIT(talink, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);

View File

@ -426,9 +426,7 @@ tostruct_tkey(ARGS_TOSTRUCT) {
REQUIRE(tkey != NULL);
REQUIRE(rdata->length != 0);
tkey->common.rdclass = rdata->rdclass;
tkey->common.rdtype = rdata->type;
ISC_LINK_INIT(&tkey->common, link);
DNS_RDATACOMMON_INIT(tkey, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &sr);

View File

@ -264,9 +264,7 @@ tostruct_tlsa(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == dns_rdatatype_tlsa);
REQUIRE(tlsa != NULL);
tlsa->common.rdclass = rdata->rdclass;
tlsa->common.rdtype = rdata->type;
ISC_LINK_INIT(&tlsa->common, link);
DNS_RDATACOMMON_INIT(tlsa, rdata->type, rdata->rdclass);
return generic_tostruct_tlsa(CALL_TOSTRUCT);
}

View File

@ -207,9 +207,7 @@ tostruct_txt(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == dns_rdatatype_txt);
REQUIRE(txt != NULL);
txt->common.rdclass = rdata->rdclass;
txt->common.rdtype = rdata->type;
ISC_LINK_INIT(&txt->common, link);
DNS_RDATACOMMON_INIT(txt, rdata->type, rdata->rdclass);
return generic_tostruct_txt(CALL_TOSTRUCT);
}

View File

@ -210,9 +210,7 @@ tostruct_uri(ARGS_TOSTRUCT) {
REQUIRE(uri != NULL);
REQUIRE(rdata->length >= 4);
uri->common.rdclass = rdata->rdclass;
uri->common.rdtype = rdata->type;
ISC_LINK_INIT(&uri->common, link);
DNS_RDATACOMMON_INIT(uri, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &sr);

View File

@ -75,9 +75,7 @@ tostruct_wallet(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == dns_rdatatype_wallet);
REQUIRE(wallet != NULL);
wallet->common.rdclass = rdata->rdclass;
wallet->common.rdtype = rdata->type;
ISC_LINK_INIT(&wallet->common, link);
DNS_RDATACOMMON_INIT(wallet, rdata->type, rdata->rdclass);
return generic_tostruct_txt(CALL_TOSTRUCT);
}

View File

@ -145,9 +145,7 @@ tostruct_x25(ARGS_TOSTRUCT) {
REQUIRE(x25 != NULL);
REQUIRE(rdata->length != 0);
x25->common.rdclass = rdata->rdclass;
x25->common.rdtype = rdata->type;
ISC_LINK_INIT(&x25->common, link);
DNS_RDATACOMMON_INIT(x25, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &r);
x25->x25_len = uint8_fromregion(&r);

View File

@ -256,9 +256,7 @@ tostruct_zonemd(ARGS_TOSTRUCT) {
REQUIRE(zonemd != NULL);
REQUIRE(rdata->length != 0);
zonemd->common.rdclass = rdata->rdclass;
zonemd->common.rdtype = rdata->type;
ISC_LINK_INIT(&zonemd->common, link);
DNS_RDATACOMMON_INIT(zonemd, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);

View File

@ -158,9 +158,7 @@ tostruct_hs_a(ARGS_TOSTRUCT) {
UNUSED(mctx);
a->common.rdclass = rdata->rdclass;
a->common.rdtype = rdata->type;
ISC_LINK_INIT(&a->common, link);
DNS_RDATACOMMON_INIT(a, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);
n = uint32_fromregion(&region);

View File

@ -347,9 +347,7 @@ tostruct_in_a6(ARGS_TOSTRUCT) {
REQUIRE(a6 != NULL);
REQUIRE(rdata->length != 0);
a6->common.rdclass = rdata->rdclass;
a6->common.rdtype = rdata->type;
ISC_LINK_INIT(&a6->common, link);
DNS_RDATACOMMON_INIT(a6, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &r);

View File

@ -159,9 +159,7 @@ tostruct_in_a(ARGS_TOSTRUCT) {
UNUSED(mctx);
a->common.rdclass = rdata->rdclass;
a->common.rdtype = rdata->type;
ISC_LINK_INIT(&a->common, link);
DNS_RDATACOMMON_INIT(a, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);
n = uint32_fromregion(&region);

View File

@ -171,9 +171,7 @@ tostruct_in_aaaa(ARGS_TOSTRUCT) {
UNUSED(mctx);
aaaa->common.rdclass = rdata->rdclass;
aaaa->common.rdtype = rdata->type;
ISC_LINK_INIT(&aaaa->common, link);
DNS_RDATACOMMON_INIT(aaaa, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &r);
INSIST(r.length == 16);

View File

@ -288,9 +288,7 @@ tostruct_in_apl(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == dns_rdatatype_apl);
REQUIRE(rdata->rdclass == dns_rdataclass_in);
apl->common.rdclass = rdata->rdclass;
apl->common.rdtype = rdata->type;
ISC_LINK_INIT(&apl->common, link);
DNS_RDATACOMMON_INIT(apl, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &r);
apl->apl_len = r.length;

View File

@ -224,9 +224,7 @@ tostruct_in_atma(ARGS_TOSTRUCT) {
REQUIRE(atma != NULL);
REQUIRE(rdata->length != 0);
atma->common.rdclass = rdata->rdclass;
atma->common.rdtype = rdata->type;
ISC_LINK_INIT(&atma->common, link);
DNS_RDATACOMMON_INIT(atma, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &r);
atma->format = r.base[0];

View File

@ -144,9 +144,7 @@ tostruct_in_dhcid(ARGS_TOSTRUCT) {
REQUIRE(dhcid != NULL);
REQUIRE(rdata->length != 0);
dhcid->common.rdclass = rdata->rdclass;
dhcid->common.rdtype = rdata->type;
ISC_LINK_INIT(&dhcid->common, link);
DNS_RDATACOMMON_INIT(dhcid, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);

View File

@ -133,9 +133,7 @@ tostruct_in_eid(ARGS_TOSTRUCT) {
REQUIRE(eid != NULL);
REQUIRE(rdata->length != 0);
eid->common.rdclass = rdata->rdclass;
eid->common.rdtype = rdata->type;
ISC_LINK_INIT(&eid->common, link);
DNS_RDATACOMMON_INIT(eid, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &r);
eid->eid_len = r.length;

View File

@ -189,9 +189,7 @@ tostruct_in_kx(ARGS_TOSTRUCT) {
REQUIRE(kx != NULL);
REQUIRE(rdata->length != 0);
kx->common.rdclass = rdata->rdclass;
kx->common.rdtype = rdata->type;
ISC_LINK_INIT(&kx->common, link);
DNS_RDATACOMMON_INIT(kx, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -133,9 +133,7 @@ tostruct_in_nimloc(ARGS_TOSTRUCT) {
REQUIRE(nimloc != NULL);
REQUIRE(rdata->length != 0);
nimloc->common.rdclass = rdata->rdclass;
nimloc->common.rdtype = rdata->type;
ISC_LINK_INIT(&nimloc->common, link);
DNS_RDATACOMMON_INIT(nimloc, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &r);
nimloc->nimloc_len = r.length;

View File

@ -154,9 +154,7 @@ tostruct_in_nsap_ptr(ARGS_TOSTRUCT) {
REQUIRE(nsap_ptr != NULL);
REQUIRE(rdata->length != 0);
nsap_ptr->common.rdclass = rdata->rdclass;
nsap_ptr->common.rdtype = rdata->type;
ISC_LINK_INIT(&nsap_ptr->common, link);
DNS_RDATACOMMON_INIT(nsap_ptr, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -168,9 +168,7 @@ tostruct_in_nsap(ARGS_TOSTRUCT) {
REQUIRE(nsap != NULL);
REQUIRE(rdata->length != 0);
nsap->common.rdclass = rdata->rdclass;
nsap->common.rdtype = rdata->type;
ISC_LINK_INIT(&nsap->common, link);
DNS_RDATACOMMON_INIT(nsap, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &r);
nsap->nsap_len = r.length;

View File

@ -258,9 +258,7 @@ tostruct_in_px(ARGS_TOSTRUCT) {
REQUIRE(px != NULL);
REQUIRE(rdata->length != 0);
px->common.rdclass = rdata->rdclass;
px->common.rdtype = rdata->type;
ISC_LINK_INIT(&px->common, link);
DNS_RDATACOMMON_INIT(px, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -268,9 +268,7 @@ tostruct_in_srv(ARGS_TOSTRUCT) {
REQUIRE(srv != NULL);
REQUIRE(rdata->length != 0);
srv->common.rdclass = rdata->rdclass;
srv->common.rdtype = rdata->type;
ISC_LINK_INIT(&srv->common, link);
DNS_RDATACOMMON_INIT(srv, rdata->type, rdata->rdclass);
dns_name_init(&name, NULL);
dns_rdata_toregion(rdata, &region);

View File

@ -1013,9 +1013,7 @@ generic_tostruct_in_svcb(ARGS_TOSTRUCT) {
REQUIRE(svcb != NULL);
REQUIRE(rdata->length != 0);
svcb->common.rdclass = rdata->rdclass;
svcb->common.rdtype = rdata->type;
ISC_LINK_INIT(&svcb->common, link);
DNS_RDATACOMMON_INIT(svcb, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);

View File

@ -305,9 +305,7 @@ tostruct_in_wks(ARGS_TOSTRUCT) {
REQUIRE(rdata->rdclass == dns_rdataclass_in);
REQUIRE(rdata->length != 0);
wks->common.rdclass = rdata->rdclass;
wks->common.rdtype = rdata->type;
ISC_LINK_INIT(&wks->common, link);
DNS_RDATACOMMON_INIT(wks, rdata->type, rdata->rdclass);
dns_rdata_toregion(rdata, &region);
n = uint32_fromregion(&region);