2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

refactor dns_clientinfo_init(); use separate function to set ECS

Instead of using an extra rarely-used paramater to dns_clientinfo_init()
to set ECS information for a client, this commit adds a function
dns_clientinfo_setecs() which can be called only when ECS is needed.
This commit is contained in:
Evan Hunt
2022-01-31 12:10:29 -08:00
parent 0792544872
commit ff3fdaa424
4 changed files with 50 additions and 38 deletions

View File

@@ -25,11 +25,15 @@ dns_clientinfomethods_init(dns_clientinfomethods_t *methods,
}
void
dns_clientinfo_init(dns_clientinfo_t *ci, void *data, dns_ecs_t *ecs,
void *versionp) {
dns_clientinfo_init(dns_clientinfo_t *ci, void *data, void *versionp) {
ci->version = DNS_CLIENTINFO_VERSION;
ci->data = data;
ci->dbversion = versionp;
dns_ecs_init(&ci->ecs);
}
void
dns_clientinfo_setecs(dns_clientinfo_t *ci, dns_ecs_t *ecs) {
if (ecs != NULL) {
ci->ecs = *ecs;
} else {