summaryrefslogtreecommitdiff
path: root/src/clients/s6-dnsip4.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-11-17 20:23:56 +0000
committerLaurent Bercot <ska@appnovation.com>2023-11-17 20:23:56 +0000
commitd06529686f89074fd4fa574ac6012f8a873e7857 (patch)
treee2fd4e499d8a633feeff288a9d42e904abca8903 /src/clients/s6-dnsip4.c
parent9d432bd8a07dd36247339c40fa6bf2719600fdb2 (diff)
downloads6-dns-d06529686f89074fd4fa574ac6012f8a873e7857.tar.xz
Prepare for 2.3.7.0; ignore link-local addresses in /etc/hosts
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/clients/s6-dnsip4.c')
-rw-r--r--src/clients/s6-dnsip4.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/clients/s6-dnsip4.c b/src/clients/s6-dnsip4.c
index 370c006..6112e14 100644
--- a/src/clients/s6-dnsip4.c
+++ b/src/clients/s6-dnsip4.c
@@ -11,9 +11,7 @@
#include <skalibs/tai.h>
#include <skalibs/random.h>
-#include <s6-dns/s6dns-rci.h>
-#include <s6-dns/hosts.h>
-#include <s6-dns/s6dns-resolve.h>
+#include <s6-dns/s6dns.h>
#define USAGE "s6-dnsip4 [ -q ] [ -H | -h ] [ -r ] [ -t timeout ] domain"
#define dieusage() strerr_dieusage(100, USAGE)
@@ -53,13 +51,8 @@ int main (int argc, char const *const *argv)
if (t) tain_from_millisecs(&deadline, t) ; else deadline = tain_infinite_relative ;
tain_add_g(&deadline, &deadline) ;
- if (!s6dns_rci_init(&s6dns_rci_here, "/etc/resolv.conf"))
- strerr_diefu1sys(111, "initialize structures from /etc/resolv.conf") ;
- if (flaghosts)
- {
- flaghosts = s6dns_hosts_init(&s6dns_hosts_here, "/etc/hosts", "/etc/hosts.cdb", "/tmp/hosts.cdb") ;
- if (flaghosts == -1) strerr_diefu1sys(111, "initialize hosts database from /etc/hosts or /etc/hosts.cdb") ;
- }
+ if (!s6dns_init_options(flaghosts))
+ strerr_diefu1sys(111, "parse from /etc/resolv.conf or /etc/hosts") ;
if (flaghosts)
{