From: Vladimír Čunát Date: Wed, 21 Mar 2018 11:01:42 +0000 (+0100) Subject: nsrep: give advantage to IPv6 also for FORWARD-like X-Git-Tag: v3.2.0~29^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=929407333154422f33cbc8867e89c7d6e55fbefb;p=thirdparty%2Fknot-resolver.git nsrep: give advantage to IPv6 also for FORWARD-like --- diff --git a/NEWS b/NEWS index 360cc99b9..d3b7e3ef2 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,8 @@ Bugfixes Improvements ------------ - Dockerfile: rework, basing on Debian instead of Alpine +- policy.{FORWARD,TLS_FORWARD,STUB}: give advantage to IPv6 + when choosing whom to ask, just as for iteration Knot Resolver 3.1.0 (2018-11-02) diff --git a/lib/nsrep.c b/lib/nsrep.c index ea4b11fc2..f5ef21ce3 100644 --- a/lib/nsrep.c +++ b/lib/nsrep.c @@ -509,6 +509,9 @@ int kr_nsrep_sort(struct kr_nsrep *ns, kr_nsrep_rtt_lru_t *rtt_cache) scores[i] = 1; } else { scores[i] = rtt_cache_entry->score; + if (sa->sa_family == AF_INET) { + scores[i] += FAVOUR_IPV6; + } } if (VERBOSE_STATUS) { char sa_str[INET6_ADDRSTRLEN];