summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2008-06-10 00:23:04 +0000
committerStef Walter <stef@memberwebs.com>2008-06-10 00:23:04 +0000
commit35f85589b1485606ec9aff277d95c826e024d5b7 (patch)
tree43b395b0d8b24573562826b6ac7a2719a8d49340
parentd51dfc6d13785641061bb7e7d5909a7a0f3ecfdb (diff)
Use resolving hints properly
-rw-r--r--tools/notify-dns-slaves.c7
1 files changed, 6 insertions, 1 deletions
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);