From 87521fc8eff52fc4bc3bbb5a0ac80d81634bc1e0 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 28 Nov 2006 01:54:16 +0000 Subject: Fixed asynchronous resolving on FreeBSD --- daemon/snmp-engine.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'daemon') diff --git a/daemon/snmp-engine.c b/daemon/snmp-engine.c index 1d1b64a..65bc1de 100644 --- a/daemon/snmp-engine.c +++ b/daemon/snmp-engine.c @@ -637,6 +637,7 @@ static int resolve_timer(mstime when, void* arg) { rb_host* host; + struct addrinfo hints; /* Go through hosts and see which ones need resolving */ for(host = g_state.hosts; host; host = host->next) @@ -647,9 +648,13 @@ resolve_timer(mstime when, void* arg) if(when - host->resolve_interval > host->last_resolve_try) { + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_DGRAM; + /* Automatically strips port number */ rb_messagex(LOG_DEBUG, "resolving host: %s", host->hostname); - async_resolver_queue(host->hostname, "161", resolve_cb, host); + async_resolver_queue(host->hostname, "161", &hints, resolve_cb, host); host->last_resolve_try = when; } -- cgit v1.2.3