aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorCharles Longeau <github@chl.be>2014-06-01 19:32:58 +0200
committerCharles Longeau <github@chl.be>2014-06-01 19:32:58 +0200
commit3de2ad24d3574da3e7775633727b01ceed8c6040 (patch)
tree5db89016cc578516a3074170a3ba78ac10afc4c4 /contrib
parentadd missing #include "includes.h" (diff)
downloadOpenSMTPD-3de2ad24d3574da3e7775633727b01ceed8c6040.tar.xz
OpenSMTPD-3de2ad24d3574da3e7775633727b01ceed8c6040.zip
sync asr with latest upstream changes
Diffstat (limited to 'contrib')
-rw-r--r--contrib/lib/libc/asr/CVS/Entries49
-rw-r--r--contrib/lib/libc/asr/asr.c7
-rw-r--r--contrib/lib/libc/asr/asr_debug.c5
-rw-r--r--contrib/lib/libc/asr/asr_private.h6
-rw-r--r--contrib/lib/libc/asr/asr_utils.c5
-rw-r--r--contrib/lib/libc/asr/getaddrinfo.c7
-rw-r--r--contrib/lib/libc/asr/getaddrinfo_async.c45
-rw-r--r--contrib/lib/libc/asr/gethostnamadr.c7
-rw-r--r--contrib/lib/libc/asr/gethostnamadr_async.c9
-rw-r--r--contrib/lib/libc/asr/getnameinfo.c7
-rw-r--r--contrib/lib/libc/asr/getnameinfo_async.c5
-rw-r--r--contrib/lib/libc/asr/getnetnamadr.c7
-rw-r--r--contrib/lib/libc/asr/getnetnamadr_async.c9
-rw-r--r--contrib/lib/libc/asr/getrrsetbyname.c7
-rw-r--r--contrib/lib/libc/asr/getrrsetbyname_async.c9
-rw-r--r--contrib/lib/libc/asr/res_init.c6
-rw-r--r--contrib/lib/libc/asr/res_mkquery.c6
-rw-r--r--contrib/lib/libc/asr/res_query.c7
-rw-r--r--contrib/lib/libc/asr/res_search_async.c6
-rw-r--r--contrib/lib/libc/asr/res_send.c7
-rw-r--r--contrib/lib/libc/asr/res_send_async.c6
21 files changed, 143 insertions, 79 deletions
diff --git a/contrib/lib/libc/asr/CVS/Entries b/contrib/lib/libc/asr/CVS/Entries
index 9d659658..39082729 100644
--- a/contrib/lib/libc/asr/CVS/Entries
+++ b/contrib/lib/libc/asr/CVS/Entries
@@ -1,26 +1,25 @@
-/asr.c/1.31/Result of merge//
-/asr.h/1.7/Result of merge//
-/asr_debug.c/1.14/Result of merge//
-/getaddrinfo_async.c/1.19/Result of merge//
-/getnameinfo_async.c/1.7/Result of merge//
-/getnetnamadr_async.c/1.10/Result of merge//
-/getrrsetbyname_async.c/1.5/Result of merge//
-/res_search_async.c/1.10/Result of merge//
-/res_send_async.c/1.19/Result of merge//
-/Makefile.inc/1.6/Sat Sep 28 15:48:04 2013//
-/asr_resolver.3/1.1/Thu Aug 8 06:55:42 2013//
-/asr_private.h/1.23/Mon Nov 25 20:11:46 2013//
-/asr_utils.c/1.9/Result of merge//
-/getaddrinfo.c/1.3/Mon Nov 25 20:11:46 2013//
-/gethostnamadr.c/1.9/Mon Nov 25 20:11:46 2013//
-/gethostnamadr_async.c/1.23/Result of merge//
-/getnameinfo.c/1.3/Mon Nov 25 20:11:46 2013//
-/getnetnamadr.c/1.6/Mon Nov 25 20:11:46 2013//
-/getrrsetbyname.c/1.3/Mon Nov 25 20:11:46 2013//
-/res_debug.c/1.1/Mon Nov 25 20:11:46 2013//
-/res_init.c/1.2/Mon Nov 25 20:11:46 2013//
-/res_mkquery.c/1.6/Mon Nov 25 20:11:46 2013//
-/res_query.c/1.6/Mon Nov 25 20:11:46 2013//
-/res_send.c/1.6/Mon Nov 25 20:11:46 2013//
-/sethostent.c/1.1/Mon Nov 25 20:11:46 2013//
+/asr.c/1.33/Result of merge+Sun Jun 1 16:04:44 2014//
+/asr_debug.c/1.17/Result of merge+Sun Jun 1 17:00:43 2014//
+/asr_run.3/1.2/Wed Mar 26 18:13:15 2014//
+/asr_utils.c/1.12/Result of merge+Sun Jun 1 17:06:07 2014//
+/getaddrinfo_async.c/1.28/Result of merge+Sun Jun 1 17:06:33 2014//
+/gethostnamadr_async.c/1.29/Result of merge+Sun Jun 1 17:09:13 2014//
+/getnameinfo_async.c/1.9/Result of merge+Sun Jun 1 17:09:13 2014//
+/getnetnamadr_async.c/1.15/Result of merge+Sun Jun 1 17:11:21 2014//
+/asr_private.h/1.26/Sun Jun 1 17:05:17 2014//
+/getaddrinfo.c/1.5/Sun Jun 1 17:08:55 2014//
+/gethostnamadr.c/1.11/Sun Jun 1 17:09:49 2014//
+/getnameinfo.c/1.5/Sun Jun 1 17:11:13 2014//
+/getnetnamadr.c/1.8/Sun Jun 1 17:12:16 2014//
+/getrrsetbyname_async.c/1.7/Result of merge+Sun Jun 1 17:12:23 2014//
+/res_debug.c/1.1/Sun Jun 1 14:30:37 2014//
+/res_init.c/1.4/Result of merge+Sun Jun 1 17:12:23 2014//
+/res_search_async.c/1.13/Result of merge+Sun Jun 1 17:12:23 2014//
+/res_send_async.c/1.22/Result of merge+Sun Jun 1 17:12:23 2014//
+/sethostent.c/1.1/Sun Jun 1 14:30:37 2014//
+/Makefile.inc/1.7/Sun Jun 1 17:12:23 2014//
+/getrrsetbyname.c/1.5/Sun Jun 1 17:16:12 2014//
+/res_mkquery.c/1.8/Sun Jun 1 17:15:13 2014//
+/res_query.c/1.8/Sun Jun 1 17:14:56 2014//
+/res_send.c/1.8/Sun Jun 1 17:14:24 2014//
D
diff --git a/contrib/lib/libc/asr/asr.c b/contrib/lib/libc/asr/asr.c
index 13b6097e..8330754d 100644
--- a/contrib/lib/libc/asr/asr.c
+++ b/contrib/lib/libc/asr/asr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr.c,v 1.32 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: asr.c,v 1.33 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2010-2012 Eric Faurot <eric@openbsd.org>
*
@@ -18,16 +18,18 @@
#include "includes.h"
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <sys/time.h>
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
-#include <netdb.h>
#include <resolv.h>
#include <poll.h>
#include <stdio.h>
@@ -36,7 +38,6 @@
#include <time.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
#ifndef ASR_OPT_THREADSAFE
diff --git a/contrib/lib/libc/asr/asr_debug.c b/contrib/lib/libc/asr/asr_debug.c
index 3dc6fe51..52fc674c 100644
--- a/contrib/lib/libc/asr/asr_debug.c
+++ b/contrib/lib/libc/asr/asr_debug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr_debug.c,v 1.16 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: asr_debug.c,v 1.17 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -22,10 +22,11 @@
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <arpa/inet.h>
+#include <netdb.h>
+#include <asr.h>
#include <resolv.h>
-#include "asr.h"
#include "asr_private.h"
static const char *rcodetostr(uint16_t);
diff --git a/contrib/lib/libc/asr/asr_private.h b/contrib/lib/libc/asr/asr_private.h
index d03e6863..19803735 100644
--- a/contrib/lib/libc/asr/asr_private.h
+++ b/contrib/lib/libc/asr/asr_private.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr_private.h,v 1.25 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: asr_private.h,v 1.26 2014/04/17 15:28:26 guenther Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -17,10 +17,6 @@
#include <stdio.h>
-#ifndef ASRNODEBUG
-#define DEBUG
-#endif
-
#define QR_MASK (0x1 << 15)
#define OPCODE_MASK (0xf << 11)
#define AA_MASK (0x1 << 10)
diff --git a/contrib/lib/libc/asr/asr_utils.c b/contrib/lib/libc/asr/asr_utils.c
index 7d83ecdf..2ffc4d76 100644
--- a/contrib/lib/libc/asr/asr_utils.c
+++ b/contrib/lib/libc/asr/asr_utils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr_utils.c,v 1.11 2014/03/14 11:07:33 eric Exp $ */
+/* $OpenBSD: asr_utils.c,v 1.12 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2009-2012 Eric Faurot <eric@faurot.net>
*
@@ -23,7 +23,9 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
+#include <netdb.h>
+#include <asr.h>
#include <ctype.h>
#include <errno.h>
#include <stdint.h>
@@ -32,7 +34,6 @@
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
static int dname_check_label(const char *, size_t);
diff --git a/contrib/lib/libc/asr/getaddrinfo.c b/contrib/lib/libc/asr/getaddrinfo.c
index 074a824c..f5080572 100644
--- a/contrib/lib/libc/asr/getaddrinfo.c
+++ b/contrib/lib/libc/asr/getaddrinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getaddrinfo.c,v 1.4 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getaddrinfo.c,v 1.5 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,13 +16,14 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
-#include "asr.h"
-
int
getaddrinfo(const char *hostname, const char *servname,
const struct addrinfo *hints, struct addrinfo **res)
diff --git a/contrib/lib/libc/asr/getaddrinfo_async.c b/contrib/lib/libc/asr/getaddrinfo_async.c
index 6a0c4cde..3e223d10 100644
--- a/contrib/lib/libc/asr/getaddrinfo_async.c
+++ b/contrib/lib/libc/asr/getaddrinfo_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getaddrinfo_async.c,v 1.25 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getaddrinfo_async.c,v 1.28 2014/05/10 21:21:09 chl Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -18,25 +18,29 @@
#include "includes.h"
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
+#include <net/if.h>
#ifdef YP
#include <rpc/rpc.h>
#include <rpcsvc/yp.h>
#include <rpcsvc/ypclnt.h>
#include "ypinternal.h"
#endif
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
+#include <ifaddrs.h>
#include <resolv.h> /* for res_hnok */
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
struct match {
@@ -104,6 +108,7 @@ getaddrinfo_async(const char *hostname, const char *servname,
else {
memset(&as->as.ai.hints, 0, sizeof as->as.ai.hints);
as->as.ai.hints.ai_family = PF_UNSPEC;
+ as->as.ai.hints.ai_flags = AI_ADDRCONFIG;
}
asr_ctx_unref(ac);
@@ -127,8 +132,9 @@ getaddrinfo_async_run(struct asr_query *as, struct asr_result *ar)
char fqdn[MAXDNAME];
const char *str;
struct addrinfo *ai;
- int i, family, r;
+ int i, family, r, v4, v6;
FILE *f;
+ struct ifaddrs *ifa, *ifa0;
union {
struct sockaddr sa;
struct sockaddr_in sain;
@@ -197,6 +203,39 @@ getaddrinfo_async_run(struct asr_query *as, struct asr_result *ar)
break;
}
+ /* Restrict result set to configured address families */
+ if (ai->ai_flags & AI_ADDRCONFIG) {
+ if (getifaddrs(&ifa0) != 0) {
+ ar->ar_gai_errno = EAI_FAIL;
+ async_set_state(as, ASR_STATE_HALT);
+ break;
+ }
+ v4 = 0;
+ v6 = 0;
+ for (ifa = ifa0; ifa != NULL; ifa = ifa->ifa_next) {
+ if (ifa->ifa_flags & IFF_LOOPBACK)
+ continue;
+ if (ifa->ifa_addr->sa_family == PF_INET)
+ v4 = 1;
+ else if (ifa->ifa_addr->sa_family == PF_INET6 &&
+ !IN6_IS_ADDR_LINKLOCAL(&((struct
+ sockaddr_in6 *)ifa->ifa_addr)->sin6_addr))
+ v6 = 1;
+ }
+ freeifaddrs(ifa0);
+ if ((ai->ai_family == PF_UNSPEC && !v4 && !v6) ||
+ (ai->ai_family == PF_INET && !v4) ||
+ (ai->ai_family == PF_INET6 && !v6)) {
+ ar->ar_gai_errno = EAI_NONAME;
+ async_set_state(as, ASR_STATE_HALT);
+ break;
+ }
+ if (ai->ai_family == PF_UNSPEC && v4 && !v6)
+ ai->ai_family = PF_INET;
+ if (ai->ai_family == PF_UNSPEC && !v4 && v6)
+ ai->ai_family = PF_INET6;
+ }
+
/* Make sure there is at least a valid combination */
for (i = 0; matches[i].family != -1; i++)
if (MATCH_FAMILY(ai->ai_family, i) &&
diff --git a/contrib/lib/libc/asr/gethostnamadr.c b/contrib/lib/libc/asr/gethostnamadr.c
index a7561f13..e07abadb 100644
--- a/contrib/lib/libc/asr/gethostnamadr.c
+++ b/contrib/lib/libc/asr/gethostnamadr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gethostnamadr.c,v 1.10 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: gethostnamadr.c,v 1.11 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012,2013 Eric Faurot <eric@openbsd.org>
*
@@ -16,16 +16,17 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
-#include "asr.h"
-
static int _gethostbyname(const char *, int, struct hostent *, char *, size_t,
int *);
static int _fillhostent(const struct hostent *, struct hostent *, char *,
diff --git a/contrib/lib/libc/asr/gethostnamadr_async.c b/contrib/lib/libc/asr/gethostnamadr_async.c
index 9723db05..ba7176ce 100644
--- a/contrib/lib/libc/asr/gethostnamadr_async.c
+++ b/contrib/lib/libc/asr/gethostnamadr_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gethostnamadr_async.c,v 1.27 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: gethostnamadr_async.c,v 1.29 2014/05/13 11:57:35 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -28,7 +28,9 @@
#include <rpcsvc/ypclnt.h>
#include "ypinternal.h"
#endif
+#include <netdb.h>
+#include <asr.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
@@ -37,7 +39,6 @@
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
#define MAXALIASES 16
@@ -433,6 +434,10 @@ hostent_file_match(FILE *f, int reqtype, int family, const char *data,
return (NULL);
}
+ /* there must be an address and at least one name */
+ if (n < 2)
+ continue;
+
if (reqtype == ASR_GETHOSTBYNAME) {
for (i = 1; i < n; i++) {
if (strcasecmp(data, tokens[i]))
diff --git a/contrib/lib/libc/asr/getnameinfo.c b/contrib/lib/libc/asr/getnameinfo.c
index 4ca82dae..60b5b17c 100644
--- a/contrib/lib/libc/asr/getnameinfo.c
+++ b/contrib/lib/libc/asr/getnameinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnameinfo.c,v 1.4 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getnameinfo.c,v 1.5 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,13 +16,14 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
-#include "asr.h"
-
int
getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
size_t hostlen, char *serv, size_t servlen, int flags)
diff --git a/contrib/lib/libc/asr/getnameinfo_async.c b/contrib/lib/libc/asr/getnameinfo_async.c
index c727f2b8..a8f88c77 100644
--- a/contrib/lib/libc/asr/getnameinfo_async.c
+++ b/contrib/lib/libc/asr/getnameinfo_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnameinfo_async.c,v 1.8 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getnameinfo_async.c,v 1.9 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -23,14 +23,15 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
static int getnameinfo_async_run(struct asr_query *, struct asr_result *);
diff --git a/contrib/lib/libc/asr/getnetnamadr.c b/contrib/lib/libc/asr/getnetnamadr.c
index 07ed822d..f3b552ab 100644
--- a/contrib/lib/libc/asr/getnetnamadr.c
+++ b/contrib/lib/libc/asr/getnetnamadr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnetnamadr.c,v 1.7 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getnetnamadr.c,v 1.8 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,15 +16,16 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
#include <stdlib.h>
#include <string.h>
-#include "asr.h"
-
static void _fillnetent(const struct netent *, struct netent *, char *buf,
size_t);
diff --git a/contrib/lib/libc/asr/getnetnamadr_async.c b/contrib/lib/libc/asr/getnetnamadr_async.c
index d024d97e..75f5d244 100644
--- a/contrib/lib/libc/asr/getnetnamadr_async.c
+++ b/contrib/lib/libc/asr/getnetnamadr_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getnetnamadr_async.c,v 1.13 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getnetnamadr_async.c,v 1.15 2014/05/13 11:57:35 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -22,7 +22,9 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
#include <resolv.h> /* for res_hnok */
@@ -30,7 +32,6 @@
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
#define MAXALIASES 16
@@ -288,6 +289,10 @@ netent_file_match(FILE *f, int reqtype, const char *data)
return (NULL);
}
+ /* there must be an address and at least one name */
+ if (n < 2)
+ continue;
+
if (reqtype == ASR_GETNETBYADDR) {
net = inet_network(tokens[1]);
if (memcmp(&net, data, sizeof net) == 0)
diff --git a/contrib/lib/libc/asr/getrrsetbyname.c b/contrib/lib/libc/asr/getrrsetbyname.c
index 359f1dd4..424725ec 100644
--- a/contrib/lib/libc/asr/getrrsetbyname.c
+++ b/contrib/lib/libc/asr/getrrsetbyname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getrrsetbyname.c,v 1.4 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getrrsetbyname.c,v 1.5 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,14 +16,15 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
#include <stdlib.h>
-#include "asr.h"
-
int
getrrsetbyname(const char *name, unsigned int class, unsigned int type,
unsigned int flags, struct rrsetinfo **res)
diff --git a/contrib/lib/libc/asr/getrrsetbyname_async.c b/contrib/lib/libc/asr/getrrsetbyname_async.c
index eb5db42d..094aa098 100644
--- a/contrib/lib/libc/asr/getrrsetbyname_async.c
+++ b/contrib/lib/libc/asr/getrrsetbyname_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getrrsetbyname_async.c,v 1.6 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getrrsetbyname_async.c,v 1.7 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -18,19 +18,20 @@
#include "includes.h"
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/uio.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
-#include <netdb.h>
#include <resolv.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
static int getrrsetbyname_async_run(struct asr_query *, struct asr_result *);
@@ -171,7 +172,7 @@ getrrsetbyname_async_run(struct asr_query *as, struct asr_result *ar)
/* The rest of this file is taken from the orignal implementation. */
-/* $OpenBSD: getrrsetbyname_async.c,v 1.6 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: getrrsetbyname_async.c,v 1.7 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2001 Jakob Schlyter. All rights reserved.
diff --git a/contrib/lib/libc/asr/res_init.c b/contrib/lib/libc/asr/res_init.c
index 86065046..f5c6cfba 100644
--- a/contrib/lib/libc/asr/res_init.c
+++ b/contrib/lib/libc/asr/res_init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_init.c,v 1.3 2014/01/15 02:25:34 sthen Exp $ */
+/* $OpenBSD: res_init.c,v 1.4 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,13 +16,15 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <arpa/nameser.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <resolv.h>
#include <string.h>
-#include "asr.h"
#include "asr_private.h"
#include "thread_private.h"
diff --git a/contrib/lib/libc/asr/res_mkquery.c b/contrib/lib/libc/asr/res_mkquery.c
index 9f2aa0de..27ed21e4 100644
--- a/contrib/lib/libc/asr/res_mkquery.c
+++ b/contrib/lib/libc/asr/res_mkquery.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_mkquery.c,v 1.7 2014/03/14 11:07:33 eric Exp $ */
+/* $OpenBSD: res_mkquery.c,v 1.8 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,14 +16,16 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/nameser.h> /* for MAXDNAME */
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
#include <string.h>
-#include "asr.h"
#include "asr_private.h"
/* This function is apparently needed by some ports. */
diff --git a/contrib/lib/libc/asr/res_query.c b/contrib/lib/libc/asr/res_query.c
index 2c6b198e..3cdec90b 100644
--- a/contrib/lib/libc/asr/res_query.c
+++ b/contrib/lib/libc/asr/res_query.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_query.c,v 1.7 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: res_query.c,v 1.8 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,15 +16,16 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
#include <string.h>
#include <stdlib.h>
-#include "asr.h"
-
int
res_query(const char *name, int class, int type, u_char *ans, int anslen)
{
diff --git a/contrib/lib/libc/asr/res_search_async.c b/contrib/lib/libc/asr/res_search_async.c
index 6a23a962..3c36d94f 100644
--- a/contrib/lib/libc/asr/res_search_async.c
+++ b/contrib/lib/libc/asr/res_search_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_search_async.c,v 1.12 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: res_search_async.c,v 1.13 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -18,16 +18,18 @@
#include "includes.h"
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/uio.h>
#include <arpa/nameser.h>
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
static int res_search_async_run(struct asr_query *, struct asr_result *);
diff --git a/contrib/lib/libc/asr/res_send.c b/contrib/lib/libc/asr/res_send.c
index b00510c4..32c94081 100644
--- a/contrib/lib/libc/asr/res_send.c
+++ b/contrib/lib/libc/asr/res_send.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_send.c,v 1.7 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: res_send.c,v 1.8 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -16,15 +16,16 @@
*/
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
+#include <netdb.h>
+#include <asr.h>
#include <errno.h>
#include <resolv.h>
#include <string.h>
#include <stdlib.h>
-#include "asr.h"
-
int
res_send(const u_char *buf, int buflen, u_char *ans, int anslen)
{
diff --git a/contrib/lib/libc/asr/res_send_async.c b/contrib/lib/libc/asr/res_send_async.c
index d8eee859..ffb2ad93 100644
--- a/contrib/lib/libc/asr/res_send_async.c
+++ b/contrib/lib/libc/asr/res_send_async.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_send_async.c,v 1.21 2014/03/25 19:48:11 eric Exp $ */
+/* $OpenBSD: res_send_async.c,v 1.22 2014/03/26 18:13:15 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -18,10 +18,13 @@
#include "includes.h"
#include <sys/types.h>
+#include <sys/socket.h>
#include <sys/uio.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
+#include <netdb.h>
+#include <asr.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
@@ -31,7 +34,6 @@
#include <string.h>
#include <unistd.h>
-#include "asr.h"
#include "asr_private.h"
#define OP_QUERY (0)