summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2019-01-24 15:32:08 +0000
committerflorian <florian@openbsd.org>2019-01-24 15:32:08 +0000
commit8e6382e305f22dc1d5bc65617f9876c069b00571 (patch)
tree97e289de38d69f47e3ef0a19836dc2d2edbc1b77
parentFix a crash on long lines when switching to another file by (diff)
downloadwireguard-openbsd-8e6382e305f22dc1d5bc65617f9876c069b00571.tar.xz
wireguard-openbsd-8e6382e305f22dc1d5bc65617f9876c069b00571.zip
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.
-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;
}