From: Marek VavruĊĦa Date: Tue, 5 Mar 2019 18:35:21 +0000 (-0800) Subject: nsrep: allow inclusion of good nameservers if there's space in selection X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fseparate-library-v3.2.1;p=thirdparty%2Fknot-resolver.git 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. --- 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);