2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Cause runtime probing of v6 addresses to fail, even if we can actually

make v6 sockets, but we do not have struct in6_pktinfo.

Add a check in configure.in for struct in6_pktinfo.

Use the result of that check to define (if needed) in6_pktinfo in net.h.

This change makes us build on platforms that have SOME ipv6 structures
(like in6_addr, etc) but not enough to be useful to us.

Note:  Before making an ipv6 socket the code should verify that ipv6
sockets can be made using isc_net_probeipv6().  It should also
check for v4 sockets using isc_net_probeipv4() to be consistant.
This commit is contained in:
Michael Graff
2000-05-06 01:30:32 +00:00
parent 7c80c51030
commit ece3d6c356
6 changed files with 231 additions and 173 deletions

365
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -13,7 +13,7 @@ dnl PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dnl ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS dnl ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
dnl SOFTWARE. dnl SOFTWARE.
AC_REVISION($Revision: 1.124 $) AC_REVISION($Revision: 1.125 $)
AC_PREREQ(2.13) AC_PREREQ(2.13)
@@ -616,6 +616,8 @@ case "$enable_ipv6" in
;; ;;
esac esac
echo "======= $found_ipv6"
case "$found_ipv6" in case "$found_ipv6" in
yes) yes)
ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1" ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
@@ -630,11 +632,22 @@ case "$found_ipv6" in
ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"], ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"],
[AC_MSG_RESULT(no) [AC_MSG_RESULT(no)
ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"]) ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"])
AC_MSG_CHECKING(for in6_pktinfo)
AC_TRY_LINK([
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],
[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) no)
ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6" ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6" LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY" ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
ISC_IPV6_H="ipv6.h" ISC_IPV6_H="ipv6.h"
ISC_IPV6_O="ipv6.$O" ISC_IPV6_O="ipv6.$O"
ISC_ISCIPV6_O="unix/ipv6.$O" ISC_ISCIPV6_O="unix/ipv6.$O"
@@ -645,6 +658,7 @@ esac
AC_SUBST(ISC_PLATFORM_HAVEIPV6) AC_SUBST(ISC_PLATFORM_HAVEIPV6)
AC_SUBST(LWRES_PLATFORM_HAVEIPV6) AC_SUBST(LWRES_PLATFORM_HAVEIPV6)
AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY) AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
AC_SUBST(ISC_IPV6_H) AC_SUBST(ISC_IPV6_H)
AC_SUBST(ISC_IPV6_O) AC_SUBST(ISC_IPV6_O)
AC_SUBST(ISC_ISCIPV6_O) AC_SUBST(ISC_ISCIPV6_O)

View File

@@ -87,11 +87,6 @@ struct sockaddr_in6 {
#define SIN6_LEN 1 #define SIN6_LEN 1
#endif #endif
struct in6_pktinfo {
struct in6_addr ipi6_addr; /* src/dst IPv6 address */
unsigned int ipi6_ifindex; /* send/recv interface index */
};
/* /*
* Unspecified * Unspecified
*/ */

View File

@@ -49,6 +49,12 @@
*/ */
@ISC_PLATFORM_NEEDIN6ADDRANY@ @ISC_PLATFORM_NEEDIN6ADDRANY@
/*
* If this system has in6_pktinfo, ISC_PLATFORM_HAVEIN6PKTINFO will be
* defined.
*/
@ISC_PLATFORM_HAVEIN6PKTINFO@
/* /*
* If this system needs inet_ntop(), ISC_PLATFORM_NEEDNTOP will be defined. * If this system needs inet_ntop(), ISC_PLATFORM_NEEDNTOP will be defined.
*/ */

View File

@@ -30,6 +30,7 @@
* *
* struct in_addr * struct in_addr
* struct in6_addr * struct in6_addr
* struct in6_pktinfo
* struct sockaddr * struct sockaddr
* struct sockaddr_in * struct sockaddr_in
* struct sockaddr_in6 * struct sockaddr_in6
@@ -90,6 +91,13 @@
#include <isc/ipv6.h> #include <isc/ipv6.h>
#endif #endif
#ifndef ISC_PLATFORM_HAVEIN6PKTINFO
struct in6_pktinfo {
struct in6_addr ipi6_addr; /* src/dst IPv6 address */
unsigned int ipi6_ifindex; /* send/recv interface index */
};
#endif
/* /*
* Cope with a missing in6addr_any. * Cope with a missing in6addr_any.
*/ */

View File

@@ -68,7 +68,11 @@ static void
initialize_action(void) { initialize_action(void) {
ipv4_result = try_proto(PF_INET); ipv4_result = try_proto(PF_INET);
#ifdef ISC_PLATFORM_HAVEIPV6 #ifdef ISC_PLATFORM_HAVEIPV6
#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
ipv6_result = try_proto(PF_INET6); ipv6_result = try_proto(PF_INET6);
#else
ipv6_result = 0;
#endif
#endif #endif
} }