summaryrefslogtreecommitdiff
path: root/sys/src/cmd/ndb/dblookup.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-06-27 00:36:04 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-06-27 00:36:04 +0200
commit2dc97202de20c3e5b89e66d16e102ea393a19b6c (patch)
tree45929d8a59470daca92e704a1a801ebc9137ec32 /sys/src/cmd/ndb/dblookup.c
parent4821c261c4cea895ddcbd7c70bc71103c9a2763b (diff)
ndb/dns: purge db records on refresh for resolvers, remove old debug and testing code
when ndb/dns runs as a resolver only (cfg.cachedb == 0), we still want to purge the "local#" db records to reread dns server configuration or react to changed ip addresses. removing old poolcheck and dncheck code, these bugs have been fixed a long time ago.
Diffstat (limited to 'sys/src/cmd/ndb/dblookup.c')
-rw-r--r--sys/src/cmd/ndb/dblookup.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/sys/src/cmd/ndb/dblookup.c b/sys/src/cmd/ndb/dblookup.c
index 50d9e367d..106395a39 100644
--- a/sys/src/cmd/ndb/dblookup.c
+++ b/sys/src/cmd/ndb/dblookup.c
@@ -579,23 +579,6 @@ doaxfr(Ndb *db, char *name)
return 0;
}
-
-/*
- * read the all the soa's from the database to determine area's.
- * this is only used when we're not caching the database.
- */
-static void
-dbfile2area(Ndb *db)
-{
- Ndbtuple *t;
-
- if(debug)
- dnslog("rereading %s", db->file);
- Bseek(&db->b, 0, 0);
- while(t = ndbparse(db))
- ndbfree(t);
-}
-
/*
* read the database into the cache
*/
@@ -750,23 +733,23 @@ db2cache(int doit)
/* reload straddle-server configuration */
loaddomsrvs();
- if(cfg.cachedb){
- /* mark all db records as timed out */
- dnagedb();
+ /* mark all db records as timed out */
+ dnagedb();
+ if(cfg.cachedb){
/* read in new entries */
for(ndb = db; ndb; ndb = ndb->next)
dbfile2cache(ndb);
+ }
- /* mark as authoritative anything in our domain */
- dnauthdb();
+ /*
+ * mark as authoritative anything in our domain,
+ * delete timed out db records
+ */
+ dnauthdb();
- /* remove old entries */
- dnageall(1);
- } else
- /* read all the soa's to get database defaults */
- for(ndb = db; ndb; ndb = ndb->next)
- dbfile2area(ndb);
+ /* remove old entries */
+ dnageall(1);
doit = 0;
lastyoungest = youngest;