Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
BIND
Commits
703e1c0b
Commit
703e1c0b
authored
Jan 18, 2001
by
Brian Wellington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
692. [bug] Deal with systems that have getaddrinfo() but not
gai_strerror(). [RT #679]
parent
297af857
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
123 additions
and
45 deletions
+123
-45
CHANGES
CHANGES
+3
-0
acconfig.h
acconfig.h
+5
-2
bin/dig/dighost.c
bin/dig/dighost.c
+15
-6
bin/nsupdate/nsupdate.c
bin/nsupdate/nsupdate.c
+15
-7
config.h.in
config.h.in
+6
-3
configure
configure
+77
-26
configure.in
configure.in
+2
-1
No files found.
CHANGES
View file @
703e1c0b
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]
...
...
acconfig.h
View file @
703e1c0b
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: acconfig.h,v 1.3
2
2001/01/
09 21:39:01
bwelling Exp $ */
/* $Id: acconfig.h,v 1.3
3
2001/01/
18 22:21:22
bwelling Exp $ */
/***
*** This file is not to be included by any public header files, because
...
...
@@ -64,9 +64,12 @@
/* define if struct addrinfo exists */
#undef HAVE_ADDRINFO
/* define i
s
getaddrinfo() exists */
/* define i
f
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.
*/
...
...
bin/dig/dighost.c
View file @
703e1c0b
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dighost.c,v 1.18
5
2001/01/18
05:12:41 gson
Exp $ */
/* $Id: dighost.c,v 1.18
6
2001/01/18
22:21:30 bwelling
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
#ifdef 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
;
...
...
@@ -2586,7 +2595,7 @@ void
get_address
(
char
*
host
,
in_port_t
port
,
isc_sockaddr_t
*
sockaddr
)
{
struct
in_addr
in4
;
struct
in6_addr
in6
;
#if
def
ined(HAVE_ADDRINFO) && defined(HAV
E_GETADDRINFO
)
#ifdef
US
E_GETADDRINFO
struct
addrinfo
*
res
=
NULL
;
int
result
;
#else
...
...
@@ -2604,7 +2613,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
def
ined(HAVE_ADDRINFO) && defined(HAV
E_GETADDRINFO
)
#ifdef
US
E_GETADDRINFO
debug
(
"before getaddrinfo()"
);
isc_app_block
();
result
=
getaddrinfo
(
host
,
NULL
,
NULL
,
&
res
);
...
...
bin/nsupdate/nsupdate.c
View file @
703e1c0b
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: nsupdate.c,v 1.7
6
2001/01/
09 21:40:42
bwelling Exp $ */
/* $Id: nsupdate.c,v 1.7
7
2001/01/
18 22:21:31
bwelling Exp $ */
#include <config.h>
...
...
@@ -26,10 +26,6 @@
#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
#ifdef USE_GETADDRINFO
extern
int
h_errno
;
#endif
#define MAXCMD (4 * 1024)
#define INITDATA (32 * 1024)
#define MAXDATA (64 * 1024)
...
...
@@ -493,7 +501,7 @@ static void
get_address
(
char
*
host
,
in_port_t
port
,
isc_sockaddr_t
*
sockaddr
)
{
struct
in_addr
in4
;
struct
in6_addr
in6
;
#if
def
ined(HAVE_ADDRINFO) && defined(HAV
E_GETADDRINFO
)
#ifdef
US
E_GETADDRINFO
struct
addrinfo
*
res
=
NULL
;
int
result
;
#else
...
...
@@ -506,7 +514,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
def
ined(HAVE_ADDRINFO) && defined(HAV
E_GETADDRINFO
)
#ifdef
US
E_GETADDRINFO
result
=
getaddrinfo
(
host
,
NULL
,
NULL
,
&
res
);
if
(
result
!=
0
)
{
fatal
(
"Couldn't find server '%s': %s"
,
...
...
config.h.in
View file @
703e1c0b
/* config.h.in. Generated automatically from configure.in by autoheader. */
/*
* Copyright (C) 1999
,
200
0
Internet Software Consortium.
* Copyright (C) 1999
-
200
1
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.4
0
200
0/12/23 02:45:43 tale
Exp $ */
/* $Id: config.h.in,v 1.4
1
200
1/01/18 22:21:24 bwelling
Exp $ */
/***
*** This file is not to be included by any public header files, because
...
...
@@ -75,9 +75,12 @@
/* define if struct addrinfo exists */
#undef HAVE_ADDRINFO
/* define i
s
getaddrinfo() exists */
/* define i
f
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.
*/
...
...
configure
View file @
703e1c0b
...
...
@@ -4361,6 +4361,57 @@ else
ISC_LWRES_GETADDRINFOPROTO
=
"#define ISC_LWRES_GETADDRINFOPROTO 1"
fi
echo
$ac_n
"checking for gai_strerror""...
$ac_c
"
1>&6
echo
"configure:4366: checking for gai_strerror"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_func_gai_strerror
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 4371 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gai_strerror(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gai_strerror();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_gai_strerror) || defined (__stub___gai_strerror)
choke me
#else
gai_strerror();
#endif
; return 0; }
EOF
if
{
(
eval echo
configure:4394:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
rm
-rf
conftest
*
eval
"ac_cv_func_gai_strerror=yes"
else
echo
"configure: failed program was:"
>
&5
cat
conftest.
$ac_ext
>
&5
rm
-rf
conftest
*
eval
"ac_cv_func_gai_strerror=no"
fi
rm
-f
conftest
*
fi
if
eval
"test
\"
`
echo
'$ac_cv_func_'
gai_strerror
`
\"
= yes"
;
then
echo
"
$ac_t
""yes"
1>&6
cat
>>
confdefs.h
<<
\
EOF
#define HAVE_GAISTRERROR 1
EOF
else
echo
"
$ac_t
""no"
1>&6
fi
...
...
@@ -4369,9 +4420,9 @@ fi
# Look for a sysctl call to get the list of network interfaces.
#
echo
$ac_n
"checking for interface list sysctl""...
$ac_c
"
1>&6
echo
"configure:4
373
: checking for interface list sysctl"
>
&5
echo
"configure:4
424
: checking for interface list sysctl"
>
&5
cat
>
conftest.
$ac_ext
<<
EOF
#line 4
375
"configure"
#line 4
426
"configure"
#include "confdefs.h"
#include <sys/param.h>
...
...
@@ -4401,12 +4452,12 @@ rm -f conftest*
# Check for some other useful functions that are not ever-present.
#
echo
$ac_n
"checking for strsep""...
$ac_c
"
1>&6
echo
"configure:44
0
5: checking for strsep"
>
&5
echo
"configure:445
6
: checking for strsep"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_func_strsep
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 441
0
"configure"
#line 44
6
1 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strsep(); below. */
...
...
@@ -4429,7 +4480,7 @@ strsep();
; return 0; }
EOF
if
{
(
eval echo
configure:44
33
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
if
{
(
eval echo
configure:44
84
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
rm
-rf
conftest
*
eval
"ac_cv_func_strsep=yes"
else
...
...
@@ -4450,12 +4501,12 @@ ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"
fi
echo
$ac_n
"checking for vsnprintf""...
$ac_c
"
1>&6
echo
"configure:4
454
: checking for vsnprintf"
>
&5
echo
"configure:4
505
: checking for vsnprintf"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_func_vsnprintf
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 4
459
"configure"
#line 4
510
"configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vsnprintf(); below. */
...
...
@@ -4478,7 +4529,7 @@ vsnprintf();
; return 0; }
EOF
if
{
(
eval echo
configure:4
482
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
if
{
(
eval echo
configure:4
533
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
rm
-rf
conftest
*
eval
"ac_cv_func_vsnprintf=yes"
else
...
...
@@ -4507,17 +4558,17 @@ fi
echo
$ac_n
"checking for sizeof(long long int) == sizeof(long int)""...
$ac_c
"
1>&6
echo
"configure:45
11
: checking for sizeof(long long int) == sizeof(long int)"
>
&5
echo
"configure:45
62
: checking for sizeof(long long int) == sizeof(long int)"
>
&5
if
test
"
$cross_compiling
"
=
yes
;
then
echo
"
$ac_t
""default yes"
1>&6
ISC_PLATFORM_LONGLONGEQUALLONG
=
"#define ISC_PLATFORM_LONGLONGEQUALLONG 1"
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 45
17
"configure"
#line 45
68
"configure"
#include "confdefs.h"
main() { exit(!(sizeof(long long int) == sizeof(long int))); }
EOF
if
{
(
eval echo
configure:452
1
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
&&
(
./conftest
;
exit
)
2>/dev/null
if
{
(
eval echo
configure:45
7
2:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
&&
(
./conftest
;
exit
)
2>/dev/null
then
echo
"
$ac_t
""yes"
1>&6
ISC_PLATFORM_LONGLONGEQUALLONG
=
"#define ISC_PLATFORM_LONGLONGEQUALLONG 1"
...
...
@@ -4537,12 +4588,12 @@ fi
# Security Stuff
#
echo
$ac_n
"checking for chroot""...
$ac_c
"
1>&6
echo
"configure:45
41
: checking for chroot"
>
&5
echo
"configure:45
92
: checking for chroot"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_func_chroot
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 45
46
"configure"
#line 45
97
"configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char chroot(); below. */
...
...
@@ -4565,7 +4616,7 @@ chroot();
; return 0; }
EOF
if
{
(
eval echo
configure:4
569
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
if
{
(
eval echo
configure:4
620
:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
${
ac_exeext
}
;
then
rm
-rf
conftest
*
eval
"ac_cv_func_chroot=yes"
else
...
...
@@ -4591,17 +4642,17 @@ for ac_hdr in linux/capability.h
do
ac_safe
=
`
echo
"
$ac_hdr
"
|
sed
'y%./+-%__p_%'
`
echo
$ac_n
"checking for
$ac_hdr
""...
$ac_c
"
1>&6
echo
"configure:4
595
: checking for
$ac_hdr
"
>
&5
echo
"configure:4
646
: checking for
$ac_hdr
"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_header_
$ac_safe
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 46
00
"configure"
#line 46
51
"configure"
#include "confdefs.h"
#include <
$ac_hdr
>
EOF
ac_try
=
"
$ac_cpp
conftest.
$ac_ext
>/dev/null 2>conftest.out"
{
(
eval echo
configure:46
0
5:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
{
(
eval echo
configure:465
6
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
ac_err
=
`
grep
-v
'^ *+'
conftest.out |
grep
-v
"^conftest.
${
ac_ext
}
\$
"
`
if
test
-z
"
$ac_err
"
;
then
rm
-rf
conftest
*
...
...
@@ -4631,17 +4682,17 @@ for ac_hdr in linux/prctl.h
do
ac_safe
=
`
echo
"
$ac_hdr
"
|
sed
'y%./+-%__p_%'
`
echo
$ac_n
"checking for
$ac_hdr
""...
$ac_c
"
1>&6
echo
"configure:46
35
: checking for
$ac_hdr
"
>
&5
echo
"configure:46
86
: checking for
$ac_hdr
"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_header_
$ac_safe
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 46
40
"configure"
#line 46
91
"configure"
#include "confdefs.h"
#include <
$ac_hdr
>
EOF
ac_try
=
"
$ac_cpp
conftest.
$ac_ext
>/dev/null 2>conftest.out"
{
(
eval echo
configure:46
45
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
{
(
eval echo
configure:46
96
:
\"
$ac_try
\"
)
1>&5
;
(
eval
$ac_try
)
2>&5
;
}
ac_err
=
`
grep
-v
'^ *+'
conftest.out |
grep
-v
"^conftest.
${
ac_ext
}
\$
"
`
if
test
-z
"
$ac_err
"
;
then
rm
-rf
conftest
*
...
...
@@ -4672,9 +4723,9 @@ done
# BSD/OS, and perhaps some others, don't define rlim_t.
#
echo
$ac_n
"checking for type rlim_t""...
$ac_c
"
1>&6
echo
"configure:4
676
: checking for type rlim_t"
>
&5
echo
"configure:4
727
: checking for type rlim_t"
>
&5
cat
>
conftest.
$ac_ext
<<
EOF
#line 4
678
"configure"
#line 4
729
"configure"
#include "confdefs.h"
#include <sys/types.h>
...
...
@@ -4684,7 +4735,7 @@ int main() {
rlim_t rl = 19671212; return (0);
; return 0; }
EOF
if
{
(
eval echo
configure:4
688
:
\"
$ac_compile
\"
)
1>&5
;
(
eval
$ac_compile
)
2>&5
;
}
;
then
if
{
(
eval echo
configure:4
739
:
\"
$ac_compile
\"
)
1>&5
;
(
eval
$ac_compile
)
2>&5
;
}
;
then
rm
-rf
conftest
*
echo
"
$ac_t
""yes"
1>&6
cat
>>
confdefs.h
<<
\
EOF
...
...
@@ -4777,7 +4828,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set
dummy
$ac_prog
;
ac_word
=
$2
echo
$ac_n
"checking for
$ac_word
""...
$ac_c
"
1>&6
echo
"configure:4
781
: checking for
$ac_word
"
>
&5
echo
"configure:4
832
: checking for
$ac_word
"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_path_JADE
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
...
...
@@ -4823,7 +4874,7 @@ test -n "$JADE" || JADE="jade"
SGMLDIR
=
""
echo
$ac_n
"checking for SGML files""...
$ac_c
"
1>&6
echo
"configure:48
2
7: checking for SGML files"
>
&5
echo
"configure:487
8
: checking for SGML files"
>
&5
for
d
in
/usr/pkg/share/sgml /usr/local/share/sgml
do
if
test
-f
$d
/docbook/dsssl/modular/html/docbook.dsl
...
...
@@ -4849,7 +4900,7 @@ fi
XGMLDIR
=
""
echo
$ac_n
"checking for XML files""...
$ac_c
"
1>&6
echo
"configure:4
853
: checking for XML files"
>
&5
echo
"configure:4
904
: checking for XML files"
>
&5
for
d
in
/usr/pkg/share/xml /usr/local/share/xml
do
if
test
-f
$d
/dtd/docbook/docbookx.dtd
...
...
configure.in
View file @
703e1c0b
...
...
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl
AC_REVISION($Revision: 1.21
4
$)
AC_REVISION($Revision: 1.21
5
$)
AC_INIT(lib/dns/name.c)
AC_PREREQ(2.13)
...
...
@@ -1069,6 +1069,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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment