302b22
From 908b71224037745db3d1420a37e99ee9cbb3b3b3 Mon Sep 17 00:00:00 2001
302b22
From: Petr Mensik <pemensik@redhat.com>
302b22
Date: Thu, 12 Dec 2019 16:05:25 +0100
302b22
Subject: [PATCH] Terminate query if both setup_lookup and next_origin failed
302b22
302b22
That happens in case searched name plus search domain is too long and no
302b22
shorted origin would follow.
302b22
---
302b22
 bin/dig/dighost.c | 4 ++++
302b22
 1 file changed, 4 insertions(+)
302b22
302b22
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
302b22
index 6302a98..ed9625e 100644
302b22
--- a/bin/dig/dighost.c
302b22
+++ b/bin/dig/dighost.c
302b22
@@ -2053,6 +2053,10 @@ start_lookup(void) {
302b22
 			do_lookup(current_lookup);
302b22
 		else if (next_origin(current_lookup))
302b22
 			check_next_lookup(current_lookup);
302b22
+		else {
302b22
+			cancel_lookup(current_lookup);
302b22
+			check_next_lookup(current_lookup);
302b22
+		}
302b22
 	} else {
302b22
 		check_if_done();
302b22
 	}
302b22
-- 
302b22
2.21.0
302b22