diff --git a/daemon/remote.c b/daemon/remote.c index 5f6142162..6cd52e0ba 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -1219,6 +1219,28 @@ do_flush_name(SSL* ssl, struct worker* worker, char* arg) send_ok(ssl); } +/** print root forwards */ +static int +print_root_fwds(SSL* ssl, struct config_file* cfg) +{ + struct config_stub* s; + if(!ssl_printf(ssl, "root-forward:")) + return 0; + for(s = cfg->forwards; s; s = s->next) { + if(s->name && strcmp(s->name, ".") == 0) { + struct config_strlist* p; + for(p = s->hosts; p; p = p->next) + if(!ssl_printf(ssl, " %s", p->str)) + return 0; + for(p = s->addrs; p; p = p->next) + if(!ssl_printf(ssl, " %s", p->str)) + return 0; + return ssl_printf(ssl, "\n"); + } + } + return ssl_printf(ssl, " no (using root hints)\n"); +} + /** do the status command */ static void do_status(SSL* ssl, struct worker* worker) @@ -1239,6 +1261,8 @@ do_status(SSL* ssl, struct worker* worker) } if(!ssl_printf(ssl, " ]\n")) return; + if(!print_root_fwds(ssl, worker->env.cfg)) + return; uptime = (time_t)time(NULL) - (time_t)worker->daemon->time_boot.tv_sec; if(!ssl_printf(ssl, "uptime: %u seconds\n", (unsigned)uptime)) return; diff --git a/doc/Changelog b/doc/Changelog index 0a7767116..ba9280153 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -5,6 +5,8 @@ - stats_noreset feature for unbound-control. - flush_requestlist feature for unbound-control. - libunbound version upped API (was changed 5 feb). + - unbound-control status shows if root forwarding is in use. + - slightly nicer memory management in iter-fwd code. 10 February 2009: Wouter - keys with rfc5011 REVOKE flag are skipped and not considered when diff --git a/iterator/iter_fwd.c b/iterator/iter_fwd.c index 7f378834c..d7485f624 100644 --- a/iterator/iter_fwd.c +++ b/iterator/iter_fwd.c @@ -238,6 +238,7 @@ int forwards_apply_cfg(struct iter_forwards* fwd, struct config_file* cfg) { free(fwd->tree); + regional_free_all(fwd->region); fwd->tree = rbtree_create(fwd_cmp); if(!fwd->tree) return 0; @@ -288,5 +289,6 @@ forwards_get_mem(struct iter_forwards* fwd) { if(!fwd) return 0; - return sizeof(*fwd) + regional_get_mem(fwd->region); + return sizeof(*fwd) + sizeof(*fwd->tree) + + regional_get_mem(fwd->region); }