]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
small chaos.c update
authorMiek Gieben <miekg@NLnetLabs.nl>
Tue, 3 May 2005 09:27:14 +0000 (09:27 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Tue, 3 May 2005 09:27:14 +0000 (09:27 +0000)
Makefile.in
TODO
chaos.c

index 742ac36d66c2ed0ffd4c06a9735fbbafbb7ed1de..02c351a8ada20bc060b3f2cb2affa5ffd65ad85b 100644 (file)
@@ -94,7 +94,7 @@ destclean:    uninstall
 install-doc:   doc
                echo "installing documentation"
 
-uninstall-doc:
+uninstall-doc: 
                echo "removing documentation"
 
 install-h:     lib
diff --git a/TODO b/TODO
index 24d5794344c05ff1aaaf03912ad39a0d697f4a27..44a9b388ba9e3c882e5d5a04b50825adcb367f75 100644 (file)
--- a/TODO
+++ b/TODO
@@ -27,6 +27,7 @@ o per RR functions (started, see rr_functions.c)
 o conversion from  ldns_key to key rr's
 o init function? random - load_ssl_errors()
        - SSL_load_error_str()? 
+o implement getaddrinfo() variant for ldns
 
 To ponder and discuss:
 ----------------------
diff --git a/chaos.c b/chaos.c
index a9a97fac679a7a33e08bb36ac9a597728fa22874..f06cf9c74375b36b7e6cebad0451c306bd2e1ce2 100644 (file)
--- a/chaos.c
+++ b/chaos.c
@@ -17,6 +17,14 @@ usage(FILE *fp, char *prog) {
        return 0;
 }
 
+void
+remove_nameservers(ldns_resolver *res)
+{
+       /* remove old nameservers */
+       for(; ldns_resolver_pop_nameserver(res);
+               ldns_resolver_pop_nameserver(res)) { ; }
+}
+
 int
 main(int argc, char *argv[])
 {
@@ -40,6 +48,7 @@ main(int argc, char *argv[])
                }
        }
 
+       /* create rdf for what we are going to ask */
        version = ldns_dname_new_frm_str("version.bind");
        id      = ldns_dname_new_frm_str("hostname.bind");
 
@@ -56,9 +65,8 @@ main(int argc, char *argv[])
                fprintf(stderr, " *** could not get an address for %s", argv[1]);
                exit(1);
        }
-       /* remove old nameservers */
-       for(; ldns_resolver_pop_nameserver(res);
-               ldns_resolver_pop_nameserver(res)) { ; }
+
+       remove_nameservers(res);
 
        /* can be multihomed */
        for(i = 0; i < ldns_rr_list_rr_count(addr); i++) {