From e76cff63613cf3b428311a5cae8e1a1369f74332 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Vavru=C5=A1a?= Date: Tue, 5 Mar 2019 10:35:21 -0800 Subject: [PATCH] nsrep: allow inclusion of good nameservers if there's space in selection The current algorithm doesn't work if there's 3 unknown nameservers in the address selection set, and the 4th is known working with higher score than unknown. --- lib/nsrep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nsrep.c b/lib/nsrep.c index 2af12f2c4..c992194f4 100644 --- a/lib/nsrep.c +++ b/lib/nsrep.c @@ -262,7 +262,7 @@ static int eval_nsrep(const knot_dname_t *owner, const pack_t *addr_set, struct update_nsrep_set(ns, owner, addr_choice, score); ns->reputation = reputation; return 1; /* Stop evaluation */ - } else if (ns->score > KR_NS_MAX_SCORE) { + } else if (ns->score > KR_NS_MAX_SCORE || addr_choice[KR_NSREP_MAXADDR - 1] == NULL) { /* Check if any server was already selected. * If no, pick current server and continue evaluation. */ update_nsrep_set(ns, owner, addr_choice, score); -- 2.47.2