dname isroot and dellabel

git-svn-id: file:///svn/unbound/trunk@492 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards
2007-08-06 11:06:00 +00:00
parent 44560e40ea
commit 4eaa855db9
6 changed files with 77 additions and 7 deletions
+3 -3
View File
@@ -43,6 +43,7 @@
#include "validator/val_kentry.h"
#include "util/log.h"
#include "util/config_file.h"
#include "util/data/dname.h"
struct key_cache*
key_cache_create(struct config_file* cfg)
@@ -140,10 +141,9 @@ key_cache_obtain(struct key_cache* kcache, uint8_t* name, size_t namelen,
lock_rw_unlock(&k->entry.lock);
}
/* snip off first label to continue */
if(name[0] == 0 || namelen <= 1)
if(dname_is_root(name))
break;
namelen -= (size_t)name[0] + 1;
name += (size_t)name[0] + 1;
dname_remove_label(&name, &namelen);
}
return NULL;
}