]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Wed, 7 Feb 2001 19:26:22 +0000 (19:26 +0000)
committerAndreas Gustafsson <source@isc.org>
Wed, 7 Feb 2001 19:26:22 +0000 (19:26 +0000)
 692.   [bug]           Deal with systems that have getaddrinfo() but not
                        gai_strerror(). [RT #679]

CHANGES
acconfig.h
bin/dig/dighost.c
bin/nsupdate/nsupdate.c
config.h.in
configure.in

diff --git a/CHANGES b/CHANGES
index af7a37864e88e9490dfe1a923f059e546a1f6ed7..39bffbb6d8e6e5ad411369c84f22b75bad603751 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -38,6 +38,9 @@
  693.   [bug]           An empty lwres statement in named.conf caused
                         the server to crash while loading.
 
+ 692.  [bug]           Deal with systems that have getaddrinfo() but not
+                       gai_strerror(). [RT #679]
+
  691.  [bug]           Configuring per-view forwarders caused an assertion
                        failure. [RT #675, #734]
 
index a0f2bd199987a81a391a24cb577cf9ff3a8bc4aa..56b1a65bbb8faf630867c0c0bf03066a74a5788c 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: acconfig.h,v 1.31.2.1 2001/01/09 22:31:06 bwelling Exp $ */
+/* $Id: acconfig.h,v 1.31.2.2 2001/02/07 19:26:16 gson Exp $ */
 
 /***
  *** This file is not to be included by any public header files, because
 /* define if struct addrinfo exists */
 #undef HAVE_ADDRINFO
 
-/* define is getaddrinfo() exists */
+/* define if getaddrinfo() exists */
 #undef HAVE_GETADDRINFO
 
+/* define if gai_strerror() exists */
+#undef HAVE_GAISTRERROR
+
 /* define if pthread_setconcurrency() should be called to tell the
  * OS how many threads we might want to run.
  */
index 2eac09f0f7b12179e614f2e91b04a528ff95a90e..2f7e8547e625a40557907e6d5a2f68a187ae97fb 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dighost.c,v 1.174.2.4 2001/01/12 20:39:06 bwelling Exp $ */
+/* $Id: dighost.c,v 1.174.2.5 2001/02/07 19:26:20 gson Exp $ */
 
 /*
  * Notice to programmers:  Do not use this code as an example of how to
@@ -32,9 +32,6 @@
 #include <netdb.h>
 #include <string.h>
 #include <limits.h>
-#if (!(defined(HAVE_ADDRINFO) && defined(HAVE_GETADDRINFO)))
-extern int h_errno;
-#endif
 
 #include <dns/byaddr.h>
 #include <dns/fixedname.h>
@@ -70,6 +67,18 @@ extern int h_errno;
 
 #include <dig/dig.h>
 
+#ifdef HAVE_ADDRINFO
+#ifdef HAVE_GETADDRINFO
+#ifdef HAVE_GAISTRERROR
+#define USE_GETADDRINFO
+#endif
+#endif
+#endif
+
+#ifndef USE_GETADDRINFO
+extern int h_errno;
+#endif
+
 ISC_LIST(dig_lookup_t) lookup_list;
 dig_serverlist_t server_list;
 ISC_LIST(dig_searchlist_t) search_list;
@@ -2612,7 +2621,7 @@ void
 get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr) {
        struct in_addr in4;
        struct in6_addr in6;
-#if defined(HAVE_ADDRINFO) && defined(HAVE_GETADDRINFO)
+#ifdef USE_GETADDRINFO
        struct addrinfo *res = NULL;
        int result;
 #else
@@ -2630,7 +2639,7 @@ get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr) {
        else if (inet_pton(AF_INET, host, &in4) == 1)
                isc_sockaddr_fromin(sockaddr, &in4, port);
        else {
-#if defined(HAVE_ADDRINFO) && defined(HAVE_GETADDRINFO)
+#ifdef USE_GETADDRINFO
                debug ("before getaddrinfo()");
                is_blocking = ISC_TRUE;
                result = getaddrinfo(host, NULL, NULL, &res);
index 467aafd643c61121c1de4d0c242e63712b58624d..58a7293f772b016a1abbd565fbd3d48a890fd4b2 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsupdate.c,v 1.75.2.2 2001/01/22 23:15:09 gson Exp $ */
+/* $Id: nsupdate.c,v 1.75.2.3 2001/02/07 19:26:22 gson Exp $ */
 
 #include <config.h>
 
 #include <stdlib.h>
 #include <unistd.h>
 
-#if (!(defined(HAVE_ADDRINFO) && defined(HAVE_GETADDRINFO)))
-extern int h_errno;
-#endif
-
 #include <isc/app.h>
 #include <isc/base64.h>
 #include <isc/buffer.h>
@@ -69,6 +65,18 @@ extern int h_errno;
 #include <lwres/lwres.h>
 #include <lwres/net.h>
 
+#ifdef HAVE_ADDRINFO
+#ifdef HAVE_GETADDRINFO
+#ifdef HAVE_GAISTRERROR
+#define USE_GETADDRINFO
+#endif
+#endif
+#endif
+
+#ifndef USE_GETADDRINFO
+extern int h_errno;
+#endif
+
 #define MAXCMD (4 * 1024)
 #define INITDATA (32 * 1024)
 #define MAXDATA (64 * 1024)
@@ -537,7 +545,7 @@ static void
 get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr) {
        struct in_addr in4;
        struct in6_addr in6;
-#if defined(HAVE_ADDRINFO) && defined(HAVE_GETADDRINFO)
+#ifdef USE_GETADDRINFO
        struct addrinfo *res = NULL;
        int result;
 #else
@@ -550,7 +558,7 @@ get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr) {
        else if (inet_pton(AF_INET, host, &in4) == 1)
                isc_sockaddr_fromin(sockaddr, &in4, port);
        else {
-#if defined(HAVE_ADDRINFO) && defined(HAVE_GETADDRINFO)
+#ifdef USE_GETADDRINFO
                result = getaddrinfo(host, NULL, NULL, &res);
                if (result != 0) {
                        fatal("Couldn't find server '%s': %s",
index 18d483623b32b55044c4358ec9a8b07e905ec37e..ba1c6b278d65c030834c8a2501f8ca59f144105f 100644 (file)
@@ -1,6 +1,6 @@
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
 /*
- * Copyright (C) 1999, 2000  Internet Software Consortium.
+ * Copyright (C) 1999-2001  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -16,7 +16,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: config.h.in,v 1.40 2000/12/23 02:45:43 tale Exp $ */
+/* $Id: config.h.in,v 1.40.2.1 2001/02/07 19:26:19 gson Exp $ */
 
 /***
  *** This file is not to be included by any public header files, because
 /* define if struct addrinfo exists */
 #undef HAVE_ADDRINFO
 
-/* define is getaddrinfo() exists */
+/* define if getaddrinfo() exists */
 #undef HAVE_GETADDRINFO
 
+/* define if gai_strerror() exists */
+#undef HAVE_GAISTRERROR
+
 /* define if pthread_setconcurrency() should be called to tell the
  * OS how many threads we might want to run.
  */
index bb7c3e3f96707733534d32b72f49f08008f50c02..01d00cef9b35e585d740923b04794d49f65dbd0a 100644 (file)
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
 esyscmd([sed "s/^/# /" COPYRIGHT])dnl
 AC_DIVERT_POP()dnl
 
-AC_REVISION($Revision: 1.205.2.3 $)
+AC_REVISION($Revision: 1.205.2.4 $)
 
 AC_INIT(lib/dns/name.c)
 AC_PREREQ(2.13)
@@ -1025,6 +1025,7 @@ AC_CHECK_FUNC(getaddrinfo,
         [ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
        AC_DEFINE(HAVE_GETADDRINFO)],
         [ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
+AC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
 AC_SUBST(ISC_LWRES_GETIPNODEPROTO)
 AC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
 AC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)