From 35f85589b1485606ec9aff277d95c826e024d5b7 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 10 Jun 2008 00:23:04 +0000 Subject: Use resolving hints properly --- tools/notify-dns-slaves.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/notify-dns-slaves.c b/tools/notify-dns-slaves.c index 63d1d9a..3a7f342 100644 --- a/tools/notify-dns-slaves.c +++ b/tools/notify-dns-slaves.c @@ -473,6 +473,7 @@ static int process_notify (const char *zone, const char *server, uint64_t delay) { notification *notif, **not; + struct addrinfo hints; char name[MAX_NAME * 2]; HEADER *hdr; size_t reqlen; @@ -568,9 +569,13 @@ process_notify (const char *zone, const char *server, uint64_t delay) /* Needs resolving */ if (rc == SANY_AF_DNS) { + memset (&hints, 0, sizeof (hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_DGRAM; + hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICSERV; SANY_TYPE (notif->address) = 0; debug ("resolving address: %s", notif->server); - async_resolver_queue (notif->server, "53", NULL, address_resolved, notif); + async_resolver_queue (notif->server, "53", &hints, address_resolved, notif); } else { notif->resolved = 1; prepare_and_process (notif, when); -- cgit v1.2.3