diff --git a/configure b/configure index cd89b5726c..9ea0cf99a7 100755 --- a/configure +++ b/configure @@ -748,16 +748,11 @@ ISC_PLATFORM_NEEDNTOP ISC_PLATFORM_HAVEIF_LADDRCONF ISC_PLATFORM_HAVEIF_LADDRREQ ISC_PLATFORM_HAVESCOPEID -ISC_IPV6_C -ISC_ISCIPV6_O -ISC_IPV6_O -ISC_IPV6_H ISC_PLATFORM_HAVESOCKADDRSTORAGE ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_NEEDIN6ADDRLOOPBACK ISC_PLATFORM_NEEDIN6ADDRANY ISC_PLATFORM_HAVEINADDR6 -ISC_PLATFORM_HAVEIPV6 BIND9_CO_RULE LIBTOOL_ALLOW_UNDEFINED LIBTOOL_MODE_UNINSTALL @@ -17845,13 +17840,16 @@ $as_echo_n "checking for IPv6 structures... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include + #include + #include + #include + int main () { -struct sockaddr_in6 sin6; return (0); + + struct sockaddr_in6 sin6; return (0); + ; return 0; } @@ -17859,11 +17857,11 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - found_ipv6=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - found_ipv6=no + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "IPv6 support is mandatory +See \`config.log' for more details" "$LINENO" 5; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -17914,26 +17912,21 @@ Please choose the proper path with the following command: ;; esac -# -# Now delve deeper into the suitability of the IPv6 support. -# -case "$found_ipv6" in - yes) - ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6_addr" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6_addr" >&5 $as_echo_n "checking for in6_addr... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include + #include + #include + #include int main () { -struct in6_addr in6; return (0); + + struct in6_addr in6; return (0); + ; return 0; } @@ -17941,89 +17934,32 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6" - isc_in_addr6_hack="" + ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6" + isc_in_addr6_hack="" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1" - isc_in_addr6_hack="#define in6_addr in_addr6" + ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1" + isc_in_addr6_hack="#define in6_addr in_addr6" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6addr_any" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6addr_any" >&5 $as_echo_n "checking for in6addr_any... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -$isc_in_addr6_hack + #include + #include + #include + $isc_in_addr6_hack int main () { -struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6addr_loopback" >&5 -$as_echo_n "checking for in6addr_loopback... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]); -#include -#include -#include -$isc_in_addr6_hack - -int -main () -{ -struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin6_scope_id in struct sockaddr_in6" >&5 -$as_echo_n "checking for sin6_scope_id in struct sockaddr_in6... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include - -int -main () -{ -struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0); ; return 0; } @@ -18031,27 +17967,30 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1" + ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID" + ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6_pktinfo" >&5 -$as_echo_n "checking for in6_pktinfo... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6addr_loopback" >&5 +$as_echo_n "checking for in6addr_loopback... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include + #include + #include + #include + $isc_in_addr6_hack int main () { -struct in6_pktinfo xyzzy; return (0); + + struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]); + ; return 0; } @@ -18059,25 +17998,73 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1" + ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin6_scope_id in struct sockaddr_in6" >&5 +$as_echo_n "checking for sin6_scope_id in struct sockaddr_in6... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main () +{ + + struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6_pktinfo" >&5 +$as_echo_n "checking for in6_pktinfo... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main () +{ + + struct in6_pktinfo xyzzy; return (0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no -- disabling runtime ipv6 support" >&5 $as_echo "no -- disabling runtime ipv6 support" >&6; } - ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO" + ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; - no) - ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6" - ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY" - ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO" - ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1" - ISC_IPV6_H="ipv6.h" - ISC_IPV6_O="ipv6.$O" - ISC_ISCIPV6_O="unix/ipv6.$O" - ISC_IPV6_C="ipv6.c" - ;; -esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5 $as_echo_n "checking for struct sockaddr_storage... " >&6; } @@ -18114,11 +18101,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct if_laddrreq" >&5 $as_echo_n "checking for struct if_laddrreq... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext diff --git a/configure.in b/configure.in index c77651a57e..2dbb8fc586 100644 --- a/configure.in +++ b/configure.in @@ -1934,16 +1934,19 @@ AC_SUBST(BIND9_CO_RULE) # We do the IPv6 compilation checking after libtool so that we can put # the right suffix on the files. # -AC_MSG_CHECKING(for IPv6 structures) -AC_TRY_COMPILE([ -#include -#include -#include ], -[struct sockaddr_in6 sin6; return (0);], - [AC_MSG_RESULT(yes) - found_ipv6=yes], - [AC_MSG_RESULT(no) - found_ipv6=no]) +AC_MSG_CHECKING([for IPv6 structures]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + #include + ]], + [[ + struct sockaddr_in6 sin6; return (0); + ]])], + [AC_MSG_RESULT([yes])], + [AC_MSG_FAILURE([IPv6 support is mandatory])]) # # See whether IPv6 support is provided via a Kame add-on. @@ -1985,88 +1988,89 @@ Please choose the proper path with the following command: ;; esac -# -# Now delve deeper into the suitability of the IPv6 support. -# -case "$found_ipv6" in - yes) - ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1" +AC_MSG_CHECKING([for in6_addr]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + #include + ]], + [[ + struct in6_addr in6; return (0); + ]])], + [AC_MSG_RESULT([yes]) + ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6" + isc_in_addr6_hack=""], + [AC_MSG_RESULT([no]) + ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1" + isc_in_addr6_hack="#define in6_addr in_addr6"]) - AC_MSG_CHECKING(for in6_addr) - AC_TRY_COMPILE([ -#include -#include -#include -], -[struct in6_addr in6; return (0);], - [AC_MSG_RESULT(yes) - ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6" - isc_in_addr6_hack=""], - [AC_MSG_RESULT(no) - ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1" - isc_in_addr6_hack="#define in6_addr in_addr6"]) +AC_MSG_CHECKING([for in6addr_any]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + #include + $isc_in_addr6_hack + ]], + [[ + struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]); + ]])], + [AC_MSG_RESULT([yes]) + ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"], + [AC_MSG_RESULT([no]) + ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"]) - AC_MSG_CHECKING(for in6addr_any) - AC_TRY_LINK([ -#include -#include -#include -$isc_in_addr6_hack -], - [struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);], - [AC_MSG_RESULT(yes) - ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"], - [AC_MSG_RESULT(no) - ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"]) +AC_MSG_CHECKING([for in6addr_loopback]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + #include + $isc_in_addr6_hack + ]], + [[ + struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]); + ]])], + [AC_MSG_RESULT(yes) + ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"], + [AC_MSG_RESULT(no) + ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"]) - AC_MSG_CHECKING(for in6addr_loopback) - AC_TRY_LINK([ -#include -#include -#include -$isc_in_addr6_hack -], - [struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);], - [AC_MSG_RESULT(yes) - ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"], - [AC_MSG_RESULT(no) - ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"]) +AC_MSG_CHECKING([for sin6_scope_id in struct sockaddr_in6]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + #include + ]], + [[ + struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0); + ]])], + [AC_MSG_RESULT([yes]) + ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"], + [AC_MSG_RESULT([no]) + ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"]) - AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6) - AC_TRY_COMPILE([ -#include -#include -#include -], - [struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);], - [AC_MSG_RESULT(yes) - ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"], - [AC_MSG_RESULT(no) - ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"]) - - AC_MSG_CHECKING(for in6_pktinfo) - AC_TRY_COMPILE([ -#include -#include -#include -], - [struct in6_pktinfo xyzzy; return (0);], - [AC_MSG_RESULT(yes) - ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"], - [AC_MSG_RESULT(no -- disabling runtime ipv6 support) - ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"]) - ;; - no) - ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6" - ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY" - ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO" - ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1" - ISC_IPV6_H="ipv6.h" - ISC_IPV6_O="ipv6.$O" - ISC_ISCIPV6_O="unix/ipv6.$O" - ISC_IPV6_C="ipv6.c" - ;; -esac +AC_MSG_CHECKING([for in6_pktinfo]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + #include + ]], + [[ + struct in6_pktinfo xyzzy; return (0); + ]])], + [AC_MSG_RESULT(yes) + ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"], + [AC_MSG_RESULT(no -- disabling runtime ipv6 support) + ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"]) AC_MSG_CHECKING(for struct sockaddr_storage) AC_TRY_COMPILE([ @@ -2079,16 +2083,11 @@ ISC_PLATFORM_HAVESOCKADDRSTORAGE="#define ISC_PLATFORM_HAVESOCKADDRSTORAGE 1"], [AC_MSG_RESULT(no) ISC_PLATFORM_HAVESOCKADDRSTORAGE="#undef ISC_PLATFORM_HAVESOCKADDRSTORAGE"]) -AC_SUBST(ISC_PLATFORM_HAVEIPV6) AC_SUBST(ISC_PLATFORM_HAVEINADDR6) AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY) AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK) AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO) AC_SUBST(ISC_PLATFORM_HAVESOCKADDRSTORAGE) -AC_SUBST(ISC_IPV6_H) -AC_SUBST(ISC_IPV6_O) -AC_SUBST(ISC_ISCIPV6_O) -AC_SUBST(ISC_IPV6_C) AC_SUBST(ISC_PLATFORM_HAVESCOPEID) AC_MSG_CHECKING([for struct if_laddrreq]) diff --git a/lib/isc/Makefile.in b/lib/isc/Makefile.in index 010fc65b5e..d4e316865a 100644 --- a/lib/isc/Makefile.in +++ b/lib/isc/Makefile.in @@ -26,7 +26,7 @@ CDEFINES = CWARNINGS = # Alphabetically -UNIXOBJS = @ISC_ISCIPV6_O@ unix/pk11_api.@O@ \ +UNIXOBJS = unix/pk11_api.@O@ \ unix/app.@O@ unix/dir.@O@ unix/errno.@O@ \ unix/errno2result.@O@ unix/file.@O@ unix/fsaccess.@O@ \ unix/interfaceiter.@O@ unix/keyboard.@O@ unix/meminfo.@O@ \ diff --git a/lib/isc/include/isc/ipv6.h b/lib/isc/include/isc/ipv6.h deleted file mode 100644 index 0d69379e36..0000000000 --- a/lib/isc/include/isc/ipv6.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) Internet Systems Consortium, Inc. ("ISC") - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * See the COPYRIGHT file distributed with this work for additional - * information regarding copyright ownership. - */ - -#ifndef ISC_IPV6_H -#define ISC_IPV6_H 1 - -/***** - ***** Module Info - *****/ - -/*! \file isc/ipv6.h - * \brief IPv6 definitions for systems which do not support IPv6. - * - * \li MP: - * No impact. - * - * \li Reliability: - * No anticipated impact. - * - * \li Resources: - * N/A. - * - * \li Security: - * No anticipated impact. - * - * \li Standards: - * RFC2553. - */ - -/*** - *** Imports. - ***/ - -#include -#include - -/*** - *** Types. - ***/ - -struct in6_addr { - union { - uint8_t _S6_u8[16]; - uint16_t _S6_u16[8]; - uint32_t _S6_u32[4]; - } _S6_un; -}; -#define s6_addr _S6_un._S6_u8 -#define s6_addr8 _S6_un._S6_u8 -#define s6_addr16 _S6_un._S6_u16 -#define s6_addr32 _S6_un._S6_u32 - -#define IN6ADDR_ANY_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }}} -#define IN6ADDR_LOOPBACK_INIT {{{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }}} - -LIBISC_EXTERNAL_DATA extern const struct in6_addr in6addr_any; -LIBISC_EXTERNAL_DATA extern const struct in6_addr in6addr_loopback; - -struct sockaddr_in6 { -#ifdef ISC_PLATFORM_HAVESALEN - uint8_t sin6_len; - uint8_t sin6_family; -#else - uint16_t sin6_family; -#endif - uint16_t sin6_port; - uint32_t sin6_flowinfo; - struct in6_addr sin6_addr; - uint32_t sin6_scope_id; -}; - -#ifdef ISC_PLATFORM_HAVESALEN -#define SIN6_LEN 1 -#endif - -/*% - * Unspecified - */ -#define IN6_IS_ADDR_UNSPECIFIED(a) \ - (((a)->s6_addr32[0] == 0) && \ - ((a)->s6_addr32[1] == 0) && \ - ((a)->s6_addr32[2] == 0) && \ - ((a)->s6_addr32[3] == 0)) - -/*% - * Loopback - */ -#define IN6_IS_ADDR_LOOPBACK(a) \ - (((a)->s6_addr32[0] == 0) && \ - ((a)->s6_addr32[1] == 0) && \ - ((a)->s6_addr32[2] == 0) && \ - ((a)->s6_addr32[3] == htonl(1))) - -/*% - * IPv4 compatible - */ -#define IN6_IS_ADDR_V4COMPAT(a) \ - (((a)->s6_addr32[0] == 0) && \ - ((a)->s6_addr32[1] == 0) && \ - ((a)->s6_addr32[2] == 0) && \ - ((a)->s6_addr32[3] != 0) && \ - ((a)->s6_addr32[3] != htonl(1))) - -/*% - * Mapped - */ -#define IN6_IS_ADDR_V4MAPPED(a) \ - (((a)->s6_addr32[0] == 0) && \ - ((a)->s6_addr32[1] == 0) && \ - ((a)->s6_addr32[2] == htonl(0x0000ffff))) - -/*% - * Multicast - */ -#define IN6_IS_ADDR_MULTICAST(a) \ - ((a)->s6_addr8[0] == 0xffU) - -/*% - * Unicast link / site local. - */ -#define IN6_IS_ADDR_LINKLOCAL(a) \ - (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) -#define IN6_IS_ADDR_SITELOCAL(a) \ - (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) - -#endif /* ISC_IPV6_H */ diff --git a/lib/isc/include/isc/platform.h.in b/lib/isc/include/isc/platform.h.in index 5f10e621fe..3cc5b89e1f 100644 --- a/lib/isc/include/isc/platform.h.in +++ b/lib/isc/include/isc/platform.h.in @@ -36,12 +36,6 @@ */ @ISC_PLATFORM_HAVESALEN@ -/*! \brief - * If this system has the IPv6 structure definitions, ISC_PLATFORM_HAVEIPV6 - * will be defined. - */ -@ISC_PLATFORM_HAVEIPV6@ - /*! \brief * If this system is missing in6addr_any, ISC_PLATFORM_NEEDIN6ADDRANY will * be defined. diff --git a/lib/isc/tests/socket_test.c b/lib/isc/tests/socket_test.c index 679c47cda4..1bfe65f3a2 100644 --- a/lib/isc/tests/socket_test.c +++ b/lib/isc/tests/socket_test.c @@ -412,7 +412,6 @@ ATF_TC_HEAD(udp_dscp_v6, tc) { atf_tc_set_md_var(tc, "descr", "udp dscp ipv6"); } ATF_TC_BODY(udp_dscp_v6, tc) { -#if defined(ISC_PLATFORM_HAVEIPV6) isc_result_t result; isc_sockaddr_t addr1, addr2; struct in6_addr in6; @@ -508,10 +507,6 @@ ATF_TC_BODY(udp_dscp_v6, tc) { isc_socket_detach(&s2); isc_test_end(); -#else - UNUSED(tc); - atf_tc_skip("IPv6 not available"); -#endif } /* Test TCP sendto/recv (IPv4) */ @@ -618,7 +613,6 @@ ATF_TC_HEAD(tcp_dscp_v6, tc) { atf_tc_set_md_var(tc, "descr", "tcp dscp ipv6"); } ATF_TC_BODY(tcp_dscp_v6, tc) { -#ifdef ISC_PLATFORM_HAVEIPV6 isc_result_t result; isc_sockaddr_t addr1; struct in6_addr in6; @@ -717,10 +711,6 @@ ATF_TC_BODY(tcp_dscp_v6, tc) { isc_socket_detach(&s3); isc_test_end(); -#else - UNUSED(tc); - atf_tc_skip("IPv6 not available"); -#endif } ATF_TC(net_probedscp); diff --git a/lib/isc/unix/Makefile.in b/lib/isc/unix/Makefile.in index c558494825..190540cdaf 100644 --- a/lib/isc/unix/Makefile.in +++ b/lib/isc/unix/Makefile.in @@ -21,7 +21,7 @@ CDEFINES = CWARNINGS = # Alphabetically -OBJS = @ISC_IPV6_O@ pk11_api.@O@ \ +OBJS = pk11_api.@O@ \ app.@O@ dir.@O@ errno.@O@ errno2result.@O@ \ file.@O@ fsaccess.@O@ interfaceiter.@O@ \ keyboard.@O@ meminfo.@O@ \ @@ -29,7 +29,7 @@ OBJS = @ISC_IPV6_O@ pk11_api.@O@ \ strerror.@O@ syslog.@O@ time.@O@ # Alphabetically -SRCS = @ISC_IPV6_C@ pk11_api.c \ +SRCS = pk11_api.c \ app.c dir.c errno.c errno2result.c \ file.c fsaccess.c interfaceiter.c keyboard.c meminfo.c \ net.c os.c resource.c socket.c stdio.c stdtime.c \ diff --git a/lib/isc/unix/ifiter_ioctl.c b/lib/isc/unix/ifiter_ioctl.c index 08143ae25a..fcccb7946d 100644 --- a/lib/isc/unix/ifiter_ioctl.c +++ b/lib/isc/unix/ifiter_ioctl.c @@ -397,11 +397,7 @@ internal_current4(isc_interfaceiter_t *iter) { memmove(&ifreq, ifrp, sizeof(ifreq)); family = ifreq.ifr_addr.sa_family; -#if defined(ISC_PLATFORM_HAVEIPV6) if (family != AF_INET && family != AF_INET6) -#else - if (family != AF_INET) -#endif return (ISC_R_IGNORE); memset(&iter->current, 0, sizeof(iter->current)); @@ -581,11 +577,7 @@ internal_current6(isc_interfaceiter_t *iter) { memmove(&lifreq, ifrp, sizeof(lifreq)); family = lifreq.lifr_addr.ss_family; -#ifdef ISC_PLATFORM_HAVEIPV6 if (family != AF_INET && family != AF_INET6) -#else - if (family != AF_INET) -#endif return (ISC_R_IGNORE); memset(&iter->current, 0, sizeof(iter->current)); diff --git a/lib/isc/unix/include/isc/net.h b/lib/isc/unix/include/isc/net.h index 68e73a8166..e8ea2dab55 100644 --- a/lib/isc/unix/include/isc/net.h +++ b/lib/isc/unix/include/isc/net.h @@ -77,10 +77,6 @@ #include /* Contractual promise. */ #include /* Contractual promise. */ -#ifndef ISC_PLATFORM_HAVEIPV6 -#include /* Contractual promise. */ -#endif - #include #include @@ -88,7 +84,6 @@ #define in6_addr in_addr6 /*%< Required for pre RFC2133 implementations. */ #endif -#ifdef ISC_PLATFORM_HAVEIPV6 #ifndef IN6ADDR_ANY_INIT #ifdef s6_addr /*% @@ -161,7 +156,6 @@ #define IN6_IS_ADDR_LOOPBACK(x) \ (memcmp((x)->s6_addr, in6addr_loopback.s6_addr, 16) == 0) #endif -#endif #ifndef AF_INET6 /*% IPv6 */ @@ -218,7 +212,7 @@ struct sockaddr_storage { }; #endif -#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRANY) +#if defined(ISC_PLATFORM_NEEDIN6ADDRANY) extern const struct in6_addr isc_net_in6addrany; /*% * Cope with a missing in6addr_any and in6addr_loopback. @@ -226,7 +220,7 @@ extern const struct in6_addr isc_net_in6addrany; #define in6addr_any isc_net_in6addrany #endif -#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK) +#if defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK) extern const struct in6_addr isc_net_in6addrloop; #define in6addr_loopback isc_net_in6addrloop #endif diff --git a/lib/isc/unix/ipv6.c b/lib/isc/unix/ipv6.c deleted file mode 100644 index eb77377aac..0000000000 --- a/lib/isc/unix/ipv6.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) Internet Systems Consortium, Inc. ("ISC") - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * See the COPYRIGHT file distributed with this work for additional - * information regarding copyright ownership. - */ - - -/*! \file */ - -#include - -#include - -const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; -const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; diff --git a/lib/isc/unix/net.c b/lib/isc/unix/net.c index ed4eb05180..5529fb6351 100644 --- a/lib/isc/unix/net.c +++ b/lib/isc/unix/net.c @@ -93,21 +93,19 @@ #endif /* HAVE_SYSCTLBYNAME */ -#if defined(ISC_PLATFORM_HAVEIPV6) -# if defined(ISC_PLATFORM_NEEDIN6ADDRANY) +#if defined(ISC_PLATFORM_NEEDIN6ADDRANY) const struct in6_addr isc_net_in6addrany = IN6ADDR_ANY_INIT; -# endif +#endif -# if defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK) +#if defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK) const struct in6_addr isc_net_in6addrloop = IN6ADDR_LOOPBACK_INIT; -# endif +#endif static isc_once_t once_ipv6only = ISC_ONCE_INIT; -# if defined(ISC_PLATFORM_HAVEIN6PKTINFO) +#if defined(ISC_PLATFORM_HAVEIN6PKTINFO) static isc_once_t once_ipv6pktinfo = ISC_ONCE_INIT; -# endif -#endif /* ISC_PLATFORM_HAVEIPV6 */ +#endif #ifndef ISC_CMSG_IP_TOS #ifdef __APPLE__ @@ -162,7 +160,6 @@ try_proto(int domain) { } } -#ifdef ISC_PLATFORM_HAVEIPV6 #ifdef ISC_PLATFORM_HAVEIN6PKTINFO if (domain == PF_INET6) { struct sockaddr_in6 sin6; @@ -201,7 +198,6 @@ try_proto(int domain) { } } } -#endif #endif (void)close(s); @@ -212,11 +208,9 @@ try_proto(int domain) { static void initialize_action(void) { ipv4_result = try_proto(PF_INET); -#ifdef ISC_PLATFORM_HAVEIPV6 #ifdef ISC_PLATFORM_HAVEIN6PKTINFO ipv6_result = try_proto(PF_INET6); #endif -#endif #ifdef ISC_PLATFORM_HAVESYSUNH unix_result = try_proto(PF_UNIX); #endif @@ -245,7 +239,6 @@ isc_net_probeunix(void) { return (unix_result); } -#ifdef ISC_PLATFORM_HAVEIPV6 static void try_ipv6only(void) { #ifdef IPV6_V6ONLY @@ -375,22 +368,17 @@ initialize_ipv6pktinfo(void) { try_ipv6pktinfo) == ISC_R_SUCCESS); } #endif /* ISC_PLATFORM_HAVEIN6PKTINFO */ -#endif /* ISC_PLATFORM_HAVEIPV6 */ isc_result_t isc_net_probe_ipv6only(void) { -#ifdef ISC_PLATFORM_HAVEIPV6 initialize_ipv6only(); -#endif return (ipv6only_result); } isc_result_t isc_net_probe_ipv6pktinfo(void) { -#ifdef ISC_PLATFORM_HAVEIPV6 #ifdef ISC_PLATFORM_HAVEIN6PKTINFO initialize_ipv6pktinfo(); -#endif #endif return (ipv6pktinfo_result); } @@ -672,7 +660,6 @@ try_dscp_v4(void) { static void try_dscp_v6(void) { -#ifdef ISC_PLATFORM_HAVEIPV6 #ifdef IPV6_TCLASS char strbuf[ISC_STRERRORSIZE]; struct addrinfo hints, *res0; @@ -726,7 +713,6 @@ try_dscp_v6(void) { close(s); #endif /* IPV6_TCLASS */ -#endif /* ISC_PLATFORM_HAVEIPV6 */ } static void diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index 734b3f4386..2fc4da95c0 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -2325,7 +2325,6 @@ set_rcvbuf(void) { ISC_SOCKADDR_LEN_T len; fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); -#if defined(ISC_PLATFORM_HAVEIPV6) if (fd == -1) { switch (errno) { case EPROTONOSUPPORT: @@ -2340,7 +2339,6 @@ set_rcvbuf(void) { break; } } -#endif if (fd == -1) return; @@ -2673,7 +2671,6 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock, } #endif /* SO_TIMESTAMP */ -#if defined(ISC_PLATFORM_HAVEIPV6) #ifdef ISC_PLATFORM_HAVEIN6PKTINFO #ifdef IPV6_RECVPKTINFO /* RFC 3542 */ @@ -2718,7 +2715,6 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock, sizeof(action)); } #endif -#endif /* ISC_PLATFORM_HAVEIPV6 */ #endif /* defined(USE_CMSG) */ #if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT) diff --git a/lib/isc/win32/include/isc/platform.h.in b/lib/isc/win32/include/isc/platform.h.in index 691ac00122..56eddd820f 100644 --- a/lib/isc/win32/include/isc/platform.h.in +++ b/lib/isc/win32/include/isc/platform.h.in @@ -42,7 +42,6 @@ #define PATH_MAX _MAX_PATH #endif -#define ISC_PLATFORM_HAVEIPV6 #if _MSC_VER > 1200 #define ISC_PLATFORM_HAVEIN6PKTINFO #endif diff --git a/lib/isc/win32/net.c b/lib/isc/win32/net.c index 1a6f086437..173d7bb871 100644 --- a/lib/isc/win32/net.c +++ b/lib/isc/win32/net.c @@ -40,7 +40,7 @@ #define ISC_NET_PORTRANGEHIGH 65535 #endif /* ISC_NET_PORTRANGEHIGH */ -#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRANY) +#if defined(ISC_PLATFORM_NEEDIN6ADDRANY) const struct in6_addr isc_net_in6addrany = IN6ADDR_ANY_INIT; #endif @@ -90,11 +90,9 @@ static void initialize_action(void) { InitSockets(); ipv4_result = try_proto(PF_INET); -#ifdef ISC_PLATFORM_HAVEIPV6 #ifdef ISC_PLATFORM_HAVEIN6PKTINFO ipv6_result = try_proto(PF_INET6); #endif -#endif } static void @@ -119,7 +117,6 @@ isc_net_probeunix(void) { return (ISC_R_NOTFOUND); } -#ifdef ISC_PLATFORM_HAVEIPV6 static void try_ipv6only(void) { #ifdef IPV6_V6ONLY @@ -259,22 +256,17 @@ initialize_ipv6pktinfo(void) { try_ipv6pktinfo) == ISC_R_SUCCESS); } #endif /* __notyet__ */ -#endif /* ISC_PLATFORM_HAVEIPV6 */ isc_result_t isc_net_probe_ipv6only(void) { -#ifdef ISC_PLATFORM_HAVEIPV6 initialize_ipv6only(); -#endif return (ipv6only_result); } isc_result_t isc_net_probe_ipv6pktinfo(void) { #ifdef __notyet__ -#ifdef ISC_PLATFORM_HAVEIPV6 initialize_ipv6pktinfo(); -#endif #endif /* __notyet__ */ return (ipv6pktinfo_result); } diff --git a/lib/isc/win32/socket.c b/lib/isc/win32/socket.c index 1209292dfb..f89d323589 100644 --- a/lib/isc/win32/socket.c +++ b/lib/isc/win32/socket.c @@ -188,11 +188,9 @@ enum { * to collect the destination address and interface so the client can * set them on outgoing packets. */ -#ifdef ISC_PLATFORM_HAVEIPV6 #ifndef USE_CMSG #define USE_CMSG 1 #endif -#endif /* * We really don't want to try and use these control messages. Win32 @@ -1754,7 +1752,6 @@ socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type, if (type == isc_sockettype_udp) { #if defined(USE_CMSG) -#if defined(ISC_PLATFORM_HAVEIPV6) #ifdef IPV6_RECVPKTINFO /* 2292bis */ if ((pf == AF_INET6) @@ -1786,7 +1783,6 @@ socket_create(isc_socketmgr_t *manager, int pf, isc_sockettype_t type, strbuf); } #endif /* IPV6_RECVPKTINFO */ -#endif /* ISC_PLATFORM_HAVEIPV6 */ #endif /* defined(USE_CMSG) */ #if defined(SO_RCVBUF)