summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-02-15 21:45:57 +1100
committerDarren Tucker <dtucker@zip.com.au>2005-02-15 21:45:57 +1100
commit691d5235ca9485877e8345269b1be4b2cf1be322 (patch)
tree7adbbdbb837a6d3d4953a6ea339ad9d9e6d289ce /configure.ac
parentf04c3616756831fe987fe3e474c8c234c298e4cb (diff)
- (dtucker) [README.platform auth.c configure.ac loginrec.c
openbsd-compat/port-aix.c openbsd-compat/port-aix.h] Bug #835: enable IPv6 on AIX where possible (see README.platform for details) and work around a misfeature of AIX's getnameinfo. ok djm@
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac62
1 files changed, 60 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 2df8a5e87..b27f0cf70 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.241 2005/02/11 05:11:49 dtucker Exp $ 1# $Id: configure.ac,v 1.242 2005/02/15 10:45:57 dtucker Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -135,7 +135,7 @@ case "$host" in
135 [#include <usersec.h>] 135 [#include <usersec.h>]
136 ) 136 )
137 AC_CHECK_FUNCS(setauthdb) 137 AC_CHECK_FUNCS(setauthdb)
138 AC_DEFINE(BROKEN_GETADDRINFO) 138 check_for_aix_broken_getaddrinfo=1
139 AC_DEFINE(BROKEN_REALPATH) 139 AC_DEFINE(BROKEN_REALPATH)
140 AC_DEFINE(SETEUID_BREAKS_SETUID) 140 AC_DEFINE(SETEUID_BREAKS_SETUID)
141 AC_DEFINE(BROKEN_SETREUID) 141 AC_DEFINE(BROKEN_SETREUID)
@@ -1146,6 +1146,64 @@ main(void)
1146 ) 1146 )
1147fi 1147fi
1148 1148
1149if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_aix_broken_getaddrinfo" = "x1"; then
1150 AC_MSG_CHECKING(if getaddrinfo seems to work)
1151 AC_TRY_RUN(
1152 [
1153#include <stdio.h>
1154#include <sys/socket.h>
1155#include <netdb.h>
1156#include <errno.h>
1157#include <netinet/in.h>
1158
1159#define TEST_PORT "2222"
1160
1161int
1162main(void)
1163{
1164 int err, sock;
1165 struct addrinfo *gai_ai, *ai, hints;
1166 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1167
1168 memset(&hints, 0, sizeof(hints));
1169 hints.ai_family = PF_UNSPEC;
1170 hints.ai_socktype = SOCK_STREAM;
1171 hints.ai_flags = AI_PASSIVE;
1172
1173 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1174 if (err != 0) {
1175 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1176 exit(1);
1177 }
1178
1179 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1180 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
1181 continue;
1182
1183 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1184 sizeof(ntop), strport, sizeof(strport),
1185 NI_NUMERICHOST|NI_NUMERICSERV);
1186
1187 if (ai->ai_family == AF_INET && err != 0) {
1188 perror("getnameinfo");
1189 exit(2);
1190 }
1191 }
1192 exit(0);
1193}
1194 ],
1195 [
1196 AC_MSG_RESULT(yes)
1197 AC_DEFINE(AIX_GETNAMEINFO_HACK, [],
1198[Define if you have a getaddrinfo that fails for the all-zeros IPv6 address])
1199 ],
1200 [
1201 AC_MSG_RESULT(no)
1202 AC_DEFINE(BROKEN_GETADDRINFO)
1203 ]
1204 )
1205fi
1206
1149if test "x$check_for_conflicting_getspnam" = "x1"; then 1207if test "x$check_for_conflicting_getspnam" = "x1"; then
1150 AC_MSG_CHECKING(for conflicting getspnam in shadow.h) 1208 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1151 AC_COMPILE_IFELSE( 1209 AC_COMPILE_IFELSE(