mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
- Fix local-zone type redirect that did not use the query name for
the answer rrset. git-svn-id: file:///svn/unbound/trunk@2092 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
ef10cae6eb
commit
910bad74ea
3 changed files with 41 additions and 3 deletions
|
|
@ -6,6 +6,8 @@
|
||||||
when they really are not there, the server selection is reinitiated.
|
when they really are not there, the server selection is reinitiated.
|
||||||
- Fix fetch from blacklisted dnssec lame servers as last resort. The
|
- Fix fetch from blacklisted dnssec lame servers as last resort. The
|
||||||
server's IP address is then given in validator errors as well.
|
server's IP address is then given in validator errors as well.
|
||||||
|
- Fix local-zone type redirect that did not use the query name for
|
||||||
|
the answer rrset.
|
||||||
|
|
||||||
22 April 2010: Wouter
|
22 April 2010: Wouter
|
||||||
- tag 1.4.4.
|
- tag 1.4.4.
|
||||||
|
|
|
||||||
|
|
@ -1040,10 +1040,10 @@ local_data_answer(struct local_zone* z, struct query_info* qinfo,
|
||||||
if(!lr)
|
if(!lr)
|
||||||
return 0;
|
return 0;
|
||||||
if(z->type == local_zone_redirect) {
|
if(z->type == local_zone_redirect) {
|
||||||
/* convert rrset name to zone name; like a wildcard */
|
/* convert rrset name to query name; like a wildcard */
|
||||||
struct ub_packed_rrset_key r = *lr->rrset;
|
struct ub_packed_rrset_key r = *lr->rrset;
|
||||||
r.rk.dname = z->name;
|
r.rk.dname = qinfo->qname;
|
||||||
r.rk.dname_len = z->namelen;
|
r.rk.dname_len = qinfo->qname_len;
|
||||||
return local_encode(qinfo, edns, buf, temp, &r, 1,
|
return local_encode(qinfo, edns, buf, temp, &r, 1,
|
||||||
LDNS_RCODE_NOERROR);
|
LDNS_RCODE_NOERROR);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
36
testdata/localdata.rpl
vendored
36
testdata/localdata.rpl
vendored
|
|
@ -30,6 +30,10 @@ server:
|
||||||
; refuse zone (error)
|
; refuse zone (error)
|
||||||
local-zone: "refuse.top." refuse
|
local-zone: "refuse.top." refuse
|
||||||
|
|
||||||
|
; redirect zone
|
||||||
|
local-zone: "redirect.top." redirect
|
||||||
|
local-data: "redirect.top. A 20.30.40.54"
|
||||||
|
|
||||||
; create implicit data in the IN domain as well
|
; create implicit data in the IN domain as well
|
||||||
local-data: "a.a.implicit. A 20.30.41.50"
|
local-data: "a.a.implicit. A 20.30.41.50"
|
||||||
local-data: "b.a.implicit. A 20.30.42.50"
|
local-data: "b.a.implicit. A 20.30.42.50"
|
||||||
|
|
@ -318,4 +322,36 @@ www.deny.top. IN A
|
||||||
ENTRY_END
|
ENTRY_END
|
||||||
; no answer is checked at exit of testbound.
|
; no answer is checked at exit of testbound.
|
||||||
|
|
||||||
|
; redirect zone apex
|
||||||
|
STEP 50 QUERY
|
||||||
|
ENTRY_BEGIN
|
||||||
|
SECTION QUESTION
|
||||||
|
redirect.top. IN A
|
||||||
|
ENTRY_END
|
||||||
|
STEP 51 CHECK_ANSWER
|
||||||
|
ENTRY_BEGIN
|
||||||
|
MATCH all
|
||||||
|
REPLY QR RA AA NOERROR
|
||||||
|
SECTION QUESTION
|
||||||
|
redirect.top. IN A
|
||||||
|
SECTION ANSWER
|
||||||
|
redirect.top. IN A 20.30.40.54
|
||||||
|
ENTRY_END
|
||||||
|
|
||||||
|
; redirect zone
|
||||||
|
STEP 52 QUERY
|
||||||
|
ENTRY_BEGIN
|
||||||
|
SECTION QUESTION
|
||||||
|
www.redirect.top. IN A
|
||||||
|
ENTRY_END
|
||||||
|
STEP 53 CHECK_ANSWER
|
||||||
|
ENTRY_BEGIN
|
||||||
|
MATCH all
|
||||||
|
REPLY QR RA AA NOERROR
|
||||||
|
SECTION QUESTION
|
||||||
|
www.redirect.top. IN A
|
||||||
|
SECTION ANSWER
|
||||||
|
www.redirect.top. IN A 20.30.40.54
|
||||||
|
ENTRY_END
|
||||||
|
|
||||||
SCENARIO_END
|
SCENARIO_END
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue