chiark / gitweb /
Fix typo in changelog entry for 1.6.1
[adns.git] / src / types.c
index 0c4860dc3a30c21de7bb86cea640bfe1447adf5f..d79f4a07045e99f197b83b6aaaac34e0e7156f3a 100644 (file)
@@ -3,12 +3,8 @@
  * - RR-type-specific code, and the machinery to call it
  */
 /*
- *  This file is part of adns, which is
- *    Copyright (C) 1997-2000,2003,2006,2014-2016  Ian Jackson
- *    Copyright (C) 2014  Mark Wooding
- *    Copyright (C) 1999-2000,2003,2006  Tony Finch
- *    Copyright (C) 1991 Massachusetts Institute of Technology
- *  (See the file INSTALL for full details.)
+ *  This file is part of adns, which is Copyright Ian Jackson
+ *  and contributors (see the file INSTALL for full details).
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -691,7 +687,7 @@ static void icb_addr(adns_query parent, adns_query child) {
      * settled on.
      */
     adns__cancel_children(parent);
-    r= gettimeofday(&now, 0);  if (r) goto x_gtod;
+    r= adns__gettimeofday(ads,&now);  if (r) goto x_gtod;
     qf= adns__qf_addr_cname;
     if (!(parent->flags & adns_qf_cname_loose)) qf |= adns_qf_cname_forbid;
     addr_subqueries(parent, now, qf, child->vb.buf, child->vb.used);
@@ -712,7 +708,7 @@ static void icb_addr(adns_query parent, adns_query child) {
     adns__cancel_children(parent);
     adns__free_interim(parent, pans->rrs.bytes);
     pans->rrs.bytes= 0; pans->nrrs= 0;
-    r= gettimeofday(&now, 0);  if (r) goto x_gtod;
+    r= adns__gettimeofday(ads,&now);  if (r) goto x_gtod;
     adns__search_next(ads, parent, now);
     return;
   }
@@ -737,7 +733,8 @@ x_gtod:
   /* We have our own error handling, because adns__must_gettimeofday
    * handles errors by calling adns_globalsystemfailure, which would
    * reenter the query processing logic. */
-  adns__diag(ads, -1, parent, "gettimeofday failed: %s", strerror(errno));
+  adns__diag(ads, -1, parent, "gettimeofday/clock_gettime failed: %s",
+            strerror(errno));
   err= adns_s_systemfail;
   goto x_err;
 
@@ -1007,6 +1004,7 @@ static adns_status csp_hostaddr(vbuf *vb, adns_rrtype rrt,
   adns_status st;
   char buf[20];
   int i;
+  size_t addrsz= gsz_addr(0, rrt);
 
   st= csp_domain(vb,rrp->host);  if (st) return st;
 
@@ -1026,7 +1024,7 @@ static adns_status csp_hostaddr(vbuf *vb, adns_rrtype rrt,
     CSP_ADDSTR(" (");
     for (i=0; i<rrp->naddrs; i++) {
       CSP_ADDSTR(" ");
-      st= csp_addr(vb,&rrp->addrs[i]);
+      st= csp_addr(vb, (const void*)((const char*)rrp->addrs + addrsz*i));
     }
     CSP_ADDSTR(" )");
   } else {