diff options
author | Stef Walter <stef@memberwebs.com> | 2006-11-28 01:54:16 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2006-11-28 01:54:16 +0000 |
commit | 87521fc8eff52fc4bc3bbb5a0ac80d81634bc1e0 (patch) | |
tree | fd82bb8bf0df95120247d2858ff53ffb05e21215 /daemon | |
parent | fafb8142821a34311f55971674630b674b063495 (diff) |
Fixed asynchronous resolving on FreeBSD
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/snmp-engine.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; } |