esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl
-AC_REVISION($Revision: 1.322 $)
+AC_REVISION($Revision: 1.323 $)
AC_INIT(lib/dns/name.c)
AC_PREREQ(2.13)
# which provides some (all?) of the desired functions.
#
-AC_MSG_CHECKING([for inet_ntop])
-AC_TRY_LINK([
+AC_MSG_CHECKING([for inet_ntop with IPv6 support])
+AC_TRY_RUN([
#include <sys/types.h>
+#include <sys/socket.h>
#include <netinet/in.h>
-#include <arpa/inet.h>],
- [inet_ntop(0, 0, 0, 0); return (0);],
+#include <arpa/inet.h>
+main() {
+char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
# addresses with less than four octets, like "1.2.3". Also leading
# zeros should also be rejected.
-AC_MSG_CHECKING([for inet_pton])
+AC_MSG_CHECKING([for working inet_pton with IPv6 support])
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-main() { char a[4]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
- inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 : 0); }],
+main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
+ inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
+ (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
[AC_MSG_RESULT(no)