Commit aeae941a authored by Ondřej Surý's avatar Ondřej Surý
Browse files

Merge branch '892-fix-redirect-name-v9_12_4_patch-v9_12' into 'v9_12'

Resolve "pass the correct name to redirect and redirect2"

See merge request !1866
parents d0fc02bc 626a1324
Pipeline #13883 passed with stages
in 2 minutes and 8 seconds
5192. [bug] configure --fips-mode failed. [GL #946]
5167. [bug] nxdomain-redirect could sometimes lookup the wrong
redirect name. [GL #892]
--- 9.12.4 released ---
--- 9.12.4rc1 released ---
......
......@@ -4787,6 +4787,7 @@ redirect2(ns_client_t *client, dns_name_t *name, dns_rdataset_t *rdataset,
dns_dbversion_t *version = NULL;
dns_zone_t *zone = NULL;
bool is_zone;
unsigned int labels;
unsigned int options;
CTRACE(ISC_LOG_DEBUG(3), "redirect2");
......@@ -4829,12 +4830,13 @@ redirect2(ns_client_t *client, dns_name_t *name, dns_rdataset_t *rdataset,
}
redirectname = dns_fixedname_initname(&fixedredirect);
if (dns_name_countlabels(name) > 1U) {
labels = dns_name_countlabels(client->query.qname);
if (labels > 1U) {
dns_name_t prefix;
unsigned int labels = dns_name_countlabels(name) - 1;
dns_name_init(&prefix, NULL);
dns_name_getlabelsequence(name, 0, labels, &prefix);
dns_name_getlabelsequence(client->query.qname, 0, labels - 1,
&prefix);
result = dns_name_concatenate(&prefix,
client->view->redirectzone,
redirectname, NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment