diff --git a/lib/dns/rdata/any_255/tsig_250.c b/lib/dns/rdata/any_255/tsig_250.c index 0d6704164a..4a57ade0a3 100644 --- a/lib/dns/rdata/any_255/tsig_250.c +++ b/lib/dns/rdata/any_255/tsig_250.c @@ -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); diff --git a/lib/dns/rdata/ch_3/a_1.c b/lib/dns/rdata/ch_3/a_1.c index 814a4c9b6f..a5361f7e42 100644 --- a/lib/dns/rdata/ch_3/a_1.c +++ b/lib/dns/rdata/ch_3/a_1.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/afsdb_18.c b/lib/dns/rdata/generic/afsdb_18.c index 00c046cd3e..37b0882d03 100644 --- a/lib/dns/rdata/generic/afsdb_18.c +++ b/lib/dns/rdata/generic/afsdb_18.c @@ -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); diff --git a/lib/dns/rdata/generic/amtrelay_260.c b/lib/dns/rdata/generic/amtrelay_260.c index 49821162dc..6825874cb9 100644 --- a/lib/dns/rdata/generic/amtrelay_260.c +++ b/lib/dns/rdata/generic/amtrelay_260.c @@ -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; diff --git a/lib/dns/rdata/generic/avc_258.c b/lib/dns/rdata/generic/avc_258.c index c32c008144..f19cb480e6 100644 --- a/lib/dns/rdata/generic/avc_258.c +++ b/lib/dns/rdata/generic/avc_258.c @@ -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); } diff --git a/lib/dns/rdata/generic/caa_257.c b/lib/dns/rdata/generic/caa_257.c index 9a543c5530..e1381b31a9 100644 --- a/lib/dns/rdata/generic/caa_257.c +++ b/lib/dns/rdata/generic/caa_257.c @@ -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); diff --git a/lib/dns/rdata/generic/cdnskey_60.c b/lib/dns/rdata/generic/cdnskey_60.c index 6a6e79dfd0..92bb1712ee 100644 --- a/lib/dns/rdata/generic/cdnskey_60.c +++ b/lib/dns/rdata/generic/cdnskey_60.c @@ -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); } diff --git a/lib/dns/rdata/generic/cds_59.c b/lib/dns/rdata/generic/cds_59.c index b4abb7adc1..d1ededbe4a 100644 --- a/lib/dns/rdata/generic/cds_59.c +++ b/lib/dns/rdata/generic/cds_59.c @@ -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); } diff --git a/lib/dns/rdata/generic/cert_37.c b/lib/dns/rdata/generic/cert_37.c index 89bf6b2a68..138c296702 100644 --- a/lib/dns/rdata/generic/cert_37.c +++ b/lib/dns/rdata/generic/cert_37.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/cname_5.c b/lib/dns/rdata/generic/cname_5.c index 962117f9d7..b955e5d7cc 100644 --- a/lib/dns/rdata/generic/cname_5.c +++ b/lib/dns/rdata/generic/cname_5.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/csync_62.c b/lib/dns/rdata/generic/csync_62.c index 0b23a57fce..10557aade7 100644 --- a/lib/dns/rdata/generic/csync_62.c +++ b/lib/dns/rdata/generic/csync_62.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/dlv_32769.c b/lib/dns/rdata/generic/dlv_32769.c index b932e8af65..8a0e7727e9 100644 --- a/lib/dns/rdata/generic/dlv_32769.c +++ b/lib/dns/rdata/generic/dlv_32769.c @@ -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); } diff --git a/lib/dns/rdata/generic/dname_39.c b/lib/dns/rdata/generic/dname_39.c index bb72c28a85..a192e00c68 100644 --- a/lib/dns/rdata/generic/dname_39.c +++ b/lib/dns/rdata/generic/dname_39.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/dnskey_48.c b/lib/dns/rdata/generic/dnskey_48.c index aff39df4a6..aeb98fc507 100644 --- a/lib/dns/rdata/generic/dnskey_48.c +++ b/lib/dns/rdata/generic/dnskey_48.c @@ -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); } diff --git a/lib/dns/rdata/generic/doa_259.c b/lib/dns/rdata/generic/doa_259.c index 6bfbc10d8e..be926981f1 100644 --- a/lib/dns/rdata/generic/doa_259.c +++ b/lib/dns/rdata/generic/doa_259.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/ds_43.c b/lib/dns/rdata/generic/ds_43.c index ebbb0b55b1..fc51b748f7 100644 --- a/lib/dns/rdata/generic/ds_43.c +++ b/lib/dns/rdata/generic/ds_43.c @@ -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); } diff --git a/lib/dns/rdata/generic/dsync_66.c b/lib/dns/rdata/generic/dsync_66.c index bd5875c690..6f57f06e18 100644 --- a/lib/dns/rdata/generic/dsync_66.c +++ b/lib/dns/rdata/generic/dsync_66.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/eui48_108.c b/lib/dns/rdata/generic/eui48_108.c index 944316a73c..604e13f7f5 100644 --- a/lib/dns/rdata/generic/eui48_108.c +++ b/lib/dns/rdata/generic/eui48_108.c @@ -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; diff --git a/lib/dns/rdata/generic/eui64_109.c b/lib/dns/rdata/generic/eui64_109.c index 1df86ce085..335dd5cd92 100644 --- a/lib/dns/rdata/generic/eui64_109.c +++ b/lib/dns/rdata/generic/eui64_109.c @@ -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; diff --git a/lib/dns/rdata/generic/gpos_27.c b/lib/dns/rdata/generic/gpos_27.c index 181293c345..32a2284bbc 100644 --- a/lib/dns/rdata/generic/gpos_27.c +++ b/lib/dns/rdata/generic/gpos_27.c @@ -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, ®ion); gpos->long_len = uint8_fromregion(®ion); diff --git a/lib/dns/rdata/generic/hinfo_13.c b/lib/dns/rdata/generic/hinfo_13.c index 3c7d12fb63..fde40b4bec 100644 --- a/lib/dns/rdata/generic/hinfo_13.c +++ b/lib/dns/rdata/generic/hinfo_13.c @@ -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, ®ion); hinfo->cpu_len = uint8_fromregion(®ion); diff --git a/lib/dns/rdata/generic/hip_55.c b/lib/dns/rdata/generic/hip_55.c index f3a7076885..5948f36f4b 100644 --- a/lib/dns/rdata/generic/hip_55.c +++ b/lib/dns/rdata/generic/hip_55.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/ipseckey_45.c b/lib/dns/rdata/generic/ipseckey_45.c index d29dd0cf20..7b43c5111f 100644 --- a/lib/dns/rdata/generic/ipseckey_45.c +++ b/lib/dns/rdata/generic/ipseckey_45.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/isdn_20.c b/lib/dns/rdata/generic/isdn_20.c index 67069a0473..433527aa58 100644 --- a/lib/dns/rdata/generic/isdn_20.c +++ b/lib/dns/rdata/generic/isdn_20.c @@ -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); diff --git a/lib/dns/rdata/generic/key_25.c b/lib/dns/rdata/generic/key_25.c index 351c1149d7..503e450c3d 100644 --- a/lib/dns/rdata/generic/key_25.c +++ b/lib/dns/rdata/generic/key_25.c @@ -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); } diff --git a/lib/dns/rdata/generic/keydata_65533.c b/lib/dns/rdata/generic/keydata_65533.c index 4a34ee4daa..2a5d78cc23 100644 --- a/lib/dns/rdata/generic/keydata_65533.c +++ b/lib/dns/rdata/generic/keydata_65533.c @@ -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); diff --git a/lib/dns/rdata/generic/l32_105.c b/lib/dns/rdata/generic/l32_105.c index a9358eab70..9657711bb8 100644 --- a/lib/dns/rdata/generic/l32_105.c +++ b/lib/dns/rdata/generic/l32_105.c @@ -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, ®ion); l32->pref = uint16_fromregion(®ion); diff --git a/lib/dns/rdata/generic/l64_106.c b/lib/dns/rdata/generic/l64_106.c index 946a33bf33..5e9b42e451 100644 --- a/lib/dns/rdata/generic/l64_106.c +++ b/lib/dns/rdata/generic/l64_106.c @@ -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, ®ion); l64->pref = uint16_fromregion(®ion); diff --git a/lib/dns/rdata/generic/loc_29.c b/lib/dns/rdata/generic/loc_29.c index ec4238624f..5bd08be93b 100644 --- a/lib/dns/rdata/generic/loc_29.c +++ b/lib/dns/rdata/generic/loc_29.c @@ -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); diff --git a/lib/dns/rdata/generic/lp_107.c b/lib/dns/rdata/generic/lp_107.c index c2c53d1ef4..169fbe6b38 100644 --- a/lib/dns/rdata/generic/lp_107.c +++ b/lib/dns/rdata/generic/lp_107.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/mb_7.c b/lib/dns/rdata/generic/mb_7.c index 2823611a79..88320df7df 100644 --- a/lib/dns/rdata/generic/mb_7.c +++ b/lib/dns/rdata/generic/mb_7.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/md_3.c b/lib/dns/rdata/generic/md_3.c index 471473ac78..c9c5b22a85 100644 --- a/lib/dns/rdata/generic/md_3.c +++ b/lib/dns/rdata/generic/md_3.c @@ -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); diff --git a/lib/dns/rdata/generic/mf_4.c b/lib/dns/rdata/generic/mf_4.c index 726534232c..6952d70809 100644 --- a/lib/dns/rdata/generic/mf_4.c +++ b/lib/dns/rdata/generic/mf_4.c @@ -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); diff --git a/lib/dns/rdata/generic/mg_8.c b/lib/dns/rdata/generic/mg_8.c index 26c2981b3c..6438f17c18 100644 --- a/lib/dns/rdata/generic/mg_8.c +++ b/lib/dns/rdata/generic/mg_8.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/minfo_14.c b/lib/dns/rdata/generic/minfo_14.c index afd1160aca..f188d2d09e 100644 --- a/lib/dns/rdata/generic/minfo_14.c +++ b/lib/dns/rdata/generic/minfo_14.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/mr_9.c b/lib/dns/rdata/generic/mr_9.c index 6c1758d212..a4a68709cb 100644 --- a/lib/dns/rdata/generic/mr_9.c +++ b/lib/dns/rdata/generic/mr_9.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/mx_15.c b/lib/dns/rdata/generic/mx_15.c index 8baa31a293..0d093ad71e 100644 --- a/lib/dns/rdata/generic/mx_15.c +++ b/lib/dns/rdata/generic/mx_15.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/naptr_35.c b/lib/dns/rdata/generic/naptr_35.c index 2c1a5c7773..ab9c240fa3 100644 --- a/lib/dns/rdata/generic/naptr_35.c +++ b/lib/dns/rdata/generic/naptr_35.c @@ -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; diff --git a/lib/dns/rdata/generic/nid_104.c b/lib/dns/rdata/generic/nid_104.c index f0e76d23af..80d0533057 100644 --- a/lib/dns/rdata/generic/nid_104.c +++ b/lib/dns/rdata/generic/nid_104.c @@ -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, ®ion); nid->pref = uint16_fromregion(®ion); diff --git a/lib/dns/rdata/generic/ninfo_56.c b/lib/dns/rdata/generic/ninfo_56.c index 8bed8637d3..100acdcf46 100644 --- a/lib/dns/rdata/generic/ninfo_56.c +++ b/lib/dns/rdata/generic/ninfo_56.c @@ -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); } diff --git a/lib/dns/rdata/generic/ns_2.c b/lib/dns/rdata/generic/ns_2.c index 1ddbd1b831..01795ca5f0 100644 --- a/lib/dns/rdata/generic/ns_2.c +++ b/lib/dns/rdata/generic/ns_2.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/nsec3_50.c b/lib/dns/rdata/generic/nsec3_50.c index ffdc184783..600a90f9bd 100644 --- a/lib/dns/rdata/generic/nsec3_50.c +++ b/lib/dns/rdata/generic/nsec3_50.c @@ -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; diff --git a/lib/dns/rdata/generic/nsec3param_51.c b/lib/dns/rdata/generic/nsec3param_51.c index 5e7615e6d9..e1b8effe8b 100644 --- a/lib/dns/rdata/generic/nsec3param_51.c +++ b/lib/dns/rdata/generic/nsec3param_51.c @@ -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; diff --git a/lib/dns/rdata/generic/nsec_47.c b/lib/dns/rdata/generic/nsec_47.c index e8660e2b85..a7a831436d 100644 --- a/lib/dns/rdata/generic/nsec_47.c +++ b/lib/dns/rdata/generic/nsec_47.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/null_10.c b/lib/dns/rdata/generic/null_10.c index bde61b682d..2967a556a1 100644 --- a/lib/dns/rdata/generic/null_10.c +++ b/lib/dns/rdata/generic/null_10.c @@ -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; diff --git a/lib/dns/rdata/generic/nxt_30.c b/lib/dns/rdata/generic/nxt_30.c index 97019f9a55..1593ec5bf5 100644 --- a/lib/dns/rdata/generic/nxt_30.c +++ b/lib/dns/rdata/generic/nxt_30.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/openpgpkey_61.c b/lib/dns/rdata/generic/openpgpkey_61.c index 9b51b1f4ca..9ccfaeef75 100644 --- a/lib/dns/rdata/generic/openpgpkey_61.c +++ b/lib/dns/rdata/generic/openpgpkey_61.c @@ -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); diff --git a/lib/dns/rdata/generic/opt_41.c b/lib/dns/rdata/generic/opt_41.c index f7c4f75668..3836982b59 100644 --- a/lib/dns/rdata/generic/opt_41.c +++ b/lib/dns/rdata/generic/opt_41.c @@ -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; diff --git a/lib/dns/rdata/generic/ptr_12.c b/lib/dns/rdata/generic/ptr_12.c index faf45aecf7..d007db0449 100644 --- a/lib/dns/rdata/generic/ptr_12.c +++ b/lib/dns/rdata/generic/ptr_12.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/resinfo_261.c b/lib/dns/rdata/generic/resinfo_261.c index 7c18c40211..a34895c7a9 100644 --- a/lib/dns/rdata/generic/resinfo_261.c +++ b/lib/dns/rdata/generic/resinfo_261.c @@ -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); } diff --git a/lib/dns/rdata/generic/rkey_57.c b/lib/dns/rdata/generic/rkey_57.c index 4ed504fd2a..e2882f68ea 100644 --- a/lib/dns/rdata/generic/rkey_57.c +++ b/lib/dns/rdata/generic/rkey_57.c @@ -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); } diff --git a/lib/dns/rdata/generic/rp_17.c b/lib/dns/rdata/generic/rp_17.c index c52d6c0e1f..927af75097 100644 --- a/lib/dns/rdata/generic/rp_17.c +++ b/lib/dns/rdata/generic/rp_17.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/rrsig_46.c b/lib/dns/rdata/generic/rrsig_46.c index 8152a38beb..9a06a4892d 100644 --- a/lib/dns/rdata/generic/rrsig_46.c +++ b/lib/dns/rdata/generic/rrsig_46.c @@ -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); diff --git a/lib/dns/rdata/generic/rt_21.c b/lib/dns/rdata/generic/rt_21.c index 4807e50c34..3cbc1b0452 100644 --- a/lib/dns/rdata/generic/rt_21.c +++ b/lib/dns/rdata/generic/rt_21.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/sig_24.c b/lib/dns/rdata/generic/sig_24.c index d0fb977545..fd7487897f 100644 --- a/lib/dns/rdata/generic/sig_24.c +++ b/lib/dns/rdata/generic/sig_24.c @@ -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); diff --git a/lib/dns/rdata/generic/sink_40.c b/lib/dns/rdata/generic/sink_40.c index 1b0b5cc6e2..4ce1cf8808 100644 --- a/lib/dns/rdata/generic/sink_40.c +++ b/lib/dns/rdata/generic/sink_40.c @@ -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); diff --git a/lib/dns/rdata/generic/smimea_53.c b/lib/dns/rdata/generic/smimea_53.c index ea947770db..2ddcab81f8 100644 --- a/lib/dns/rdata/generic/smimea_53.c +++ b/lib/dns/rdata/generic/smimea_53.c @@ -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); } diff --git a/lib/dns/rdata/generic/soa_6.c b/lib/dns/rdata/generic/soa_6.c index 1e8fa4ee0f..115cddc81b 100644 --- a/lib/dns/rdata/generic/soa_6.c +++ b/lib/dns/rdata/generic/soa_6.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/spf_99.c b/lib/dns/rdata/generic/spf_99.c index 9347a74624..3991860551 100644 --- a/lib/dns/rdata/generic/spf_99.c +++ b/lib/dns/rdata/generic/spf_99.c @@ -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); } diff --git a/lib/dns/rdata/generic/sshfp_44.c b/lib/dns/rdata/generic/sshfp_44.c index 8e523a5a50..fc35f54de0 100644 --- a/lib/dns/rdata/generic/sshfp_44.c +++ b/lib/dns/rdata/generic/sshfp_44.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/ta_32768.c b/lib/dns/rdata/generic/ta_32768.c index 186190263a..151f6b500c 100644 --- a/lib/dns/rdata/generic/ta_32768.c +++ b/lib/dns/rdata/generic/ta_32768.c @@ -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); } diff --git a/lib/dns/rdata/generic/talink_58.c b/lib/dns/rdata/generic/talink_58.c index 5fd7ef3eed..fd7feb8d57 100644 --- a/lib/dns/rdata/generic/talink_58.c +++ b/lib/dns/rdata/generic/talink_58.c @@ -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, ®ion); diff --git a/lib/dns/rdata/generic/tkey_249.c b/lib/dns/rdata/generic/tkey_249.c index 5360b9e467..71031c1d5f 100644 --- a/lib/dns/rdata/generic/tkey_249.c +++ b/lib/dns/rdata/generic/tkey_249.c @@ -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); diff --git a/lib/dns/rdata/generic/tlsa_52.c b/lib/dns/rdata/generic/tlsa_52.c index 690c81bb16..cf019ae8e4 100644 --- a/lib/dns/rdata/generic/tlsa_52.c +++ b/lib/dns/rdata/generic/tlsa_52.c @@ -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); } diff --git a/lib/dns/rdata/generic/txt_16.c b/lib/dns/rdata/generic/txt_16.c index f45ac4a8b4..a3066ce519 100644 --- a/lib/dns/rdata/generic/txt_16.c +++ b/lib/dns/rdata/generic/txt_16.c @@ -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); } diff --git a/lib/dns/rdata/generic/uri_256.c b/lib/dns/rdata/generic/uri_256.c index f74f848336..f948f5006b 100644 --- a/lib/dns/rdata/generic/uri_256.c +++ b/lib/dns/rdata/generic/uri_256.c @@ -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); diff --git a/lib/dns/rdata/generic/wallet_262.c b/lib/dns/rdata/generic/wallet_262.c index 106003cc13..0cab8ee3b1 100644 --- a/lib/dns/rdata/generic/wallet_262.c +++ b/lib/dns/rdata/generic/wallet_262.c @@ -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); } diff --git a/lib/dns/rdata/generic/x25_19.c b/lib/dns/rdata/generic/x25_19.c index 4f96d591a8..34e8ed53e2 100644 --- a/lib/dns/rdata/generic/x25_19.c +++ b/lib/dns/rdata/generic/x25_19.c @@ -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); diff --git a/lib/dns/rdata/generic/zonemd_63.c b/lib/dns/rdata/generic/zonemd_63.c index 79c869e5a2..02a90dbd92 100644 --- a/lib/dns/rdata/generic/zonemd_63.c +++ b/lib/dns/rdata/generic/zonemd_63.c @@ -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, ®ion); diff --git a/lib/dns/rdata/hs_4/a_1.c b/lib/dns/rdata/hs_4/a_1.c index 706f14dd37..a516a6f345 100644 --- a/lib/dns/rdata/hs_4/a_1.c +++ b/lib/dns/rdata/hs_4/a_1.c @@ -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, ®ion); n = uint32_fromregion(®ion); diff --git a/lib/dns/rdata/in_1/a6_38.c b/lib/dns/rdata/in_1/a6_38.c index 018286f67d..5093829f2a 100644 --- a/lib/dns/rdata/in_1/a6_38.c +++ b/lib/dns/rdata/in_1/a6_38.c @@ -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); diff --git a/lib/dns/rdata/in_1/a_1.c b/lib/dns/rdata/in_1/a_1.c index 485f85df57..188d54604a 100644 --- a/lib/dns/rdata/in_1/a_1.c +++ b/lib/dns/rdata/in_1/a_1.c @@ -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, ®ion); n = uint32_fromregion(®ion); diff --git a/lib/dns/rdata/in_1/aaaa_28.c b/lib/dns/rdata/in_1/aaaa_28.c index 441085aacc..efe365fbf6 100644 --- a/lib/dns/rdata/in_1/aaaa_28.c +++ b/lib/dns/rdata/in_1/aaaa_28.c @@ -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); diff --git a/lib/dns/rdata/in_1/apl_42.c b/lib/dns/rdata/in_1/apl_42.c index 8bc130fe84..67c021062b 100644 --- a/lib/dns/rdata/in_1/apl_42.c +++ b/lib/dns/rdata/in_1/apl_42.c @@ -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; diff --git a/lib/dns/rdata/in_1/atma_34.c b/lib/dns/rdata/in_1/atma_34.c index c2749198bd..d4cf53e2bc 100644 --- a/lib/dns/rdata/in_1/atma_34.c +++ b/lib/dns/rdata/in_1/atma_34.c @@ -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]; diff --git a/lib/dns/rdata/in_1/dhcid_49.c b/lib/dns/rdata/in_1/dhcid_49.c index 8bc7624102..6f2b9dfb9f 100644 --- a/lib/dns/rdata/in_1/dhcid_49.c +++ b/lib/dns/rdata/in_1/dhcid_49.c @@ -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, ®ion); diff --git a/lib/dns/rdata/in_1/eid_31.c b/lib/dns/rdata/in_1/eid_31.c index 641a60475c..0cbad9ae4c 100644 --- a/lib/dns/rdata/in_1/eid_31.c +++ b/lib/dns/rdata/in_1/eid_31.c @@ -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; diff --git a/lib/dns/rdata/in_1/kx_36.c b/lib/dns/rdata/in_1/kx_36.c index 1328bc3b6a..9df7c33d40 100644 --- a/lib/dns/rdata/in_1/kx_36.c +++ b/lib/dns/rdata/in_1/kx_36.c @@ -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, ®ion); diff --git a/lib/dns/rdata/in_1/nimloc_32.c b/lib/dns/rdata/in_1/nimloc_32.c index 1841fe8388..80ce2bd559 100644 --- a/lib/dns/rdata/in_1/nimloc_32.c +++ b/lib/dns/rdata/in_1/nimloc_32.c @@ -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; diff --git a/lib/dns/rdata/in_1/nsap-ptr_23.c b/lib/dns/rdata/in_1/nsap-ptr_23.c index 7ed384c9ef..1d62b7cdd8 100644 --- a/lib/dns/rdata/in_1/nsap-ptr_23.c +++ b/lib/dns/rdata/in_1/nsap-ptr_23.c @@ -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, ®ion); diff --git a/lib/dns/rdata/in_1/nsap_22.c b/lib/dns/rdata/in_1/nsap_22.c index 208ae94c6c..b880d8f094 100644 --- a/lib/dns/rdata/in_1/nsap_22.c +++ b/lib/dns/rdata/in_1/nsap_22.c @@ -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; diff --git a/lib/dns/rdata/in_1/px_26.c b/lib/dns/rdata/in_1/px_26.c index 6a3c992645..b47e227799 100644 --- a/lib/dns/rdata/in_1/px_26.c +++ b/lib/dns/rdata/in_1/px_26.c @@ -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, ®ion); diff --git a/lib/dns/rdata/in_1/srv_33.c b/lib/dns/rdata/in_1/srv_33.c index 41c24381fd..dfdc610679 100644 --- a/lib/dns/rdata/in_1/srv_33.c +++ b/lib/dns/rdata/in_1/srv_33.c @@ -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, ®ion); diff --git a/lib/dns/rdata/in_1/svcb_64.c b/lib/dns/rdata/in_1/svcb_64.c index 8764617688..92adf0e493 100644 --- a/lib/dns/rdata/in_1/svcb_64.c +++ b/lib/dns/rdata/in_1/svcb_64.c @@ -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, ®ion); diff --git a/lib/dns/rdata/in_1/wks_11.c b/lib/dns/rdata/in_1/wks_11.c index 4d6f22db9a..5f9489554d 100644 --- a/lib/dns/rdata/in_1/wks_11.c +++ b/lib/dns/rdata/in_1/wks_11.c @@ -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, ®ion); n = uint32_fromregion(®ion);