summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2019-01-24 15:32:09 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2019-01-24 15:32:09 +0000
commit9e3f6bc45391465b11db9173fc82f618da95b02e (patch)
treed1897dadf4810b4287c248b6a4e8842b17e74b79 /sbin
parentb459e1dc778beb6e06186f53ffeaea339c877667 (diff)
When we switched from the fork based ub_resolve_async() to
ub_resolve_event() the heuristic to detect if the authoritative server is unreachable was adapted in the wrong way. Turns out when using ub_resolve_event() we get the correct rcode passed in (SERVFAIL). The rcode in the wire format answer_packet is still wrong though (NOERROR). But that doesn't matter since we can just check the passed in rcode.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/unwind/resolver.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c
index 3a1668ab794..d8b742c205a 100644
--- a/sbin/unwind/resolver.c
+++ b/sbin/unwind/resolver.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: resolver.c,v 1.1 2019/01/23 13:11:00 florian Exp $ */
+/* $OpenBSD: resolver.c,v 1.2 2019/01/24 15:32:08 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -511,8 +511,7 @@ resolve_done(void *arg, int rcode, void *answer_packet, int answer_len,
goto servfail;
}
- if (rcode == SERVFAIL && h.qdcount == 0 && h.id == 0) {
- /* heuristic, authority is unreachable */
+ if (rcode == SERVFAIL) {
if (res->stop != 1)
check_resolver(res);
goto servfail;
@@ -779,8 +778,7 @@ check_resolver_done(void *arg, int rcode, void *answer_packet, int answer_len,
goto out;
}
- if (rcode == SERVFAIL && h.qdcount == 0 && h.id == 0) {
- /* heuristic, authority is unreachable */
+ if (rcode == SERVFAIL) {
data->res->state = DEAD;
goto out;
}