diff options
Diffstat (limited to 'sbin/unwind')
-rw-r--r-- | sbin/unwind/resolver.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c index 400fa7f12c6..b3f90782175 100644 --- a/sbin/unwind/resolver.c +++ b/sbin/unwind/resolver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolver.c,v 1.43 2019/09/29 13:18:39 florian Exp $ */ +/* $OpenBSD: resolver.c,v 1.44 2019/09/29 17:52:02 otto Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -654,11 +654,13 @@ resolve_done(void *arg, int rcode, void *answer_packet, int answer_len, ms = elapsed.tv_sec * 1000 + elapsed.tv_nsec / 1000000; for (i = 1; i < nitems(histogram_limits); i++) { - if (ms > histogram_limits[i - 1] && ms < histogram_limits[i]) + if (ms > histogram_limits[i - 1] && ms <= histogram_limits[i]) break; } - - res->histogram[i]++; + if (i == nitems(histogram_limits)) + log_debug("histogram bucket error"); + else + res->histogram[i]++; log_debug("%s: async_id: %d, ref_cnt: %d, elapsed: %lldms, " "histogram: %lld - %lld", __func__, query_imsg->async_id, |