diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2021-01-28 07:34:35 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2021-01-28 07:34:35 +0000 |
commit | a099abb6b3be1bf0dea5fff24845b3b5851fba2a (patch) | |
tree | 6c135fdef189547d5c8aabb20f899fa3780444d9 /sbin/unwind/resolver.c | |
parent | 8c9736fcf025712cb683c936403fba4e8314e349 (diff) |
A new resolver can be created while we currently run a check with the
old configuration. We will then request another check that runs in
parallel to the old check. If the new check finishes earlier, the
current check result will be overwritten by an outdated check result
which is likely wrong.
While here fix some whitespace.
OK phessler
Diffstat (limited to 'sbin/unwind/resolver.c')
-rw-r--r-- | sbin/unwind/resolver.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c index 49f51d8a9ab..feeb6c2f27a 100644 --- a/sbin/unwind/resolver.c +++ b/sbin/unwind/resolver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolver.c,v 1.137 2021/01/27 08:30:50 florian Exp $ */ +/* $OpenBSD: resolver.c,v 1.138 2021/01/28 07:34:34 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -1513,8 +1513,6 @@ check_resolver(struct uw_resolver *resolver_to_check) evtimer_add(&resolver_to_check->check_ev, &resolver_to_check->check_tv); } - - } void @@ -1529,6 +1527,12 @@ check_resolver_done(struct uw_resolver *res, void *arg, int rcode, checked_resolver->check_running--; + if (checked_resolver != resolvers[checked_resolver->type]) { + log_debug("%s: %s: ignoring late check result", __func__, + uw_resolver_type_str[checked_resolver->type]); + goto out; + } + prev_state = checked_resolver->state; if (answer_len < LDNS_HEADER_SIZE) { |