From f0bacfe0737e316a89512d639688dd68281c8aa6 Mon Sep 17 00:00:00 2001 From: Alexander Shevtsov Date: Tue, 23 Jan 2024 10:20:20 +0100 Subject: [PATCH] moved code around --- configure.ac | 2 +- src/hesiod.c | 24 +++++------------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/configure.ac b/configure.ac index 0f8cbaa9..ba784b91 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Package version (semver) define(MAJOR, 2) define(MINOR, 99) -define(PATCH, 1) +define(PATCH, 0) # Shared library version # see: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html diff --git a/src/hesiod.c b/src/hesiod.c index 6c03121e..9241d317 100644 --- a/src/hesiod.c +++ b/src/hesiod.c @@ -8,8 +8,6 @@ #include "pool.h" #include "req.h" - - static bool hsk_hesiod_txt_push(char *name, char *text, hsk_dns_rrs_t *an) { hsk_dns_rr_t *rr = hsk_dns_rr_create(HSK_DNS_TXT); @@ -121,23 +119,6 @@ hsk_hesiod_resolve(hsk_dns_req_t *req, hsk_ns_t *ns) { msg->flags |= HSK_DNS_AA; hsk_dns_rrs_t *an = &msg->an; - - // POOL - // SIZE - if (hsk_dns_is_subdomain(req->name, "size.pool.hnsd.")) { - char size[65]; - sprintf(size, "%d", ns->pool->size); - if (!hsk_hesiod_txt_push("size.pool.hnsd.", size, an)) - goto fail; - } - - // PEERS - if (hsk_dns_is_subdomain(req->name, "name_root.tip.chain.hnsd.")) { - if (!hsk_hesiod_txt_push_hash("name_root.tip.chain.hnsd.", ns->pool->chain.tip->name_root, an)) - goto fail; - } - - // CHAIN // TIP if (hsk_dns_is_subdomain(req->name, "hash.tip.chain.hnsd.")) { @@ -154,6 +135,11 @@ hsk_hesiod_resolve(hsk_dns_req_t *req, hsk_ns_t *ns) { goto fail; } + if (hsk_dns_is_subdomain(req->name, "name_root.tip.chain.hnsd.")) { + if (!hsk_hesiod_txt_push_hash("name_root.tip.chain.hnsd.", ns->pool->chain.tip->name_root, an)) + goto fail; + } + if (hsk_dns_is_subdomain(req->name, "time.tip.chain.hnsd.")) { if (!hsk_hesiod_txt_push_u64("time.tip.chain.hnsd.", ns->pool->chain.tip->time,