mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
- Fix unbound-control forward disables configured stubs below it.
git-svn-id: file:///svn/unbound/trunk@2781 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
ccebf0ff92
commit
4b3fd4f789
2 changed files with 5 additions and 24 deletions
|
|
@ -1,3 +1,6 @@
|
|||
9 November 2012: Wouter
|
||||
- Fix unbound-control forward disables configured stubs below it.
|
||||
|
||||
7 November 2012: Wouter
|
||||
- Fixup ldns-testpkts, identical to ldns/examples.
|
||||
- iana portlist updated.
|
||||
|
|
|
|||
|
|
@ -270,25 +270,6 @@ read_forwards(struct iter_forwards* fwd, struct config_file* cfg)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/** see if zone needs to have a hole inserted */
|
||||
static int
|
||||
need_hole_insert(rbtree_t* tree, struct iter_forward_zone* zone)
|
||||
{
|
||||
struct iter_forward_zone k;
|
||||
if(rbtree_search(tree, zone))
|
||||
return 0; /* exact match exists */
|
||||
k = *zone;
|
||||
k.node.key = &k;
|
||||
/* search up the tree */
|
||||
do {
|
||||
dname_remove_label(&k.name, &k.namelen);
|
||||
k.namelabs --;
|
||||
if(rbtree_search(tree, &k))
|
||||
return 1; /* found an upper forward zone, need hole */
|
||||
} while(k.namelabs > 1);
|
||||
return 0; /* no forwards above, no holes needed */
|
||||
}
|
||||
|
||||
/** insert a stub hole (if necessary) for stub name */
|
||||
static int
|
||||
fwd_add_stub_hole(struct iter_forwards* fwd, uint16_t c, uint8_t* nm)
|
||||
|
|
@ -298,11 +279,8 @@ fwd_add_stub_hole(struct iter_forwards* fwd, uint16_t c, uint8_t* nm)
|
|||
key.dclass = c;
|
||||
key.name = nm;
|
||||
key.namelabs = dname_count_size_labels(key.name, &key.namelen);
|
||||
if(need_hole_insert(fwd->tree, &key)) {
|
||||
return forwards_insert_data(fwd, key.dclass, key.name,
|
||||
key.namelen, key.namelabs, NULL);
|
||||
}
|
||||
return 1;
|
||||
return forwards_insert_data(fwd, key.dclass, key.name,
|
||||
key.namelen, key.namelabs, NULL);
|
||||
}
|
||||
|
||||
/** make NULL entries for stubs */
|
||||
|
|
|
|||
Loading…
Reference in a new issue