diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2013-09-22 11:34:36 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2013-09-22 11:34:36 +0000 |
commit | 090f474021a3c7c46dbe024f2db2fdde018645a8 (patch) | |
tree | 3ef43d8d14a14a65e7829b49c35158b7b47e9d40 /usr.sbin/unbound/util | |
parent | 27f669c874b928fceed3e6a6e3733abbb593e014 (diff) |
merge unbound 1.4.21
Diffstat (limited to 'usr.sbin/unbound/util')
-rw-r--r-- | usr.sbin/unbound/util/netevent.c | 18 | ||||
-rw-r--r-- | usr.sbin/unbound/util/netevent.h | 2 |
2 files changed, 15 insertions, 5 deletions
diff --git a/usr.sbin/unbound/util/netevent.c b/usr.sbin/unbound/util/netevent.c index 3c1c69d7e1b..193fa8714a7 100644 --- a/usr.sbin/unbound/util/netevent.c +++ b/usr.sbin/unbound/util/netevent.c @@ -95,7 +95,13 @@ # endif /* USE_WINSOCK */ #else /* USE_MINI_EVENT */ /* we use libevent */ -# include <event.h> +# ifdef HAVE_EVENT_H +# include <event.h> +# else +# include "event2/event.h" +# include "event2/event_struct.h" +# include "event2/event_compat.h" +# endif #endif /* USE_MINI_EVENT */ /** @@ -116,7 +122,7 @@ struct internal_base { /** libevent event_base type. */ struct event_base* base; /** seconds time pointer points here */ - uint32_t secs; + time_t secs; /** timeval with current time */ struct timeval now; /** the event used for slow_accept timeouts */ @@ -165,7 +171,7 @@ comm_base_now(struct comm_base* b) if(gettimeofday(&b->eb->now, NULL) < 0) { log_err("gettimeofday: %s", strerror(errno)); } - b->eb->secs = (uint32_t)b->eb->now.tv_sec; + b->eb->secs = (time_t)b->eb->now.tv_sec; } #endif /* USE_MINI_EVENT */ @@ -252,7 +258,7 @@ comm_base_delete(struct comm_base* b) } void -comm_base_timept(struct comm_base* b, uint32_t** tt, struct timeval** tv) +comm_base_timept(struct comm_base* b, time_t** tt, struct timeval** tv) { *tt = &b->eb->secs; *tv = &b->eb->now; @@ -314,6 +320,10 @@ udp_send_errno_needs_log(struct sockaddr* addr, socklen_t addrlen) break; } #endif + /* permission denied is gotten for every send if the + * network is disconnected (on some OS), squelch it */ + if(errno == EPERM && verbosity < VERB_DETAIL) + return 0; /* squelch errors where people deploy AAAA ::ffff:bla for * authority servers, which we try for intranets. */ if(errno == EINVAL && addr_is_ip4mapped( diff --git a/usr.sbin/unbound/util/netevent.h b/usr.sbin/unbound/util/netevent.h index 0ea4cf04145..86fa28569c7 100644 --- a/usr.sbin/unbound/util/netevent.h +++ b/usr.sbin/unbound/util/netevent.h @@ -308,7 +308,7 @@ void comm_base_delete(struct comm_base* b); * @param tt: pointer to time in seconds is returned. * @param tv: pointer to time in microseconds is returned. */ -void comm_base_timept(struct comm_base* b, uint32_t** tt, struct timeval** tv); +void comm_base_timept(struct comm_base* b, time_t** tt, struct timeval** tv); /** * Dispatch the comm base events. |