Commit 3ab9c995 authored by Ondřej Surý's avatar Ondřej Surý
Browse files

Remove support for legacy systems without in6_pktinfo

parent 8c526df3
......@@ -748,7 +748,6 @@ ISC_PLATFORM_NEEDNTOP
ISC_PLATFORM_HAVEIF_LADDRCONF
ISC_PLATFORM_HAVEIF_LADDRREQ
ISC_PLATFORM_HAVESOCKADDRSTORAGE
ISC_PLATFORM_HAVEIN6PKTINFO
BIND9_CO_RULE
LIBTOOL_ALLOW_UNDEFINED
LIBTOOL_MODE_UNINSTALL
......@@ -17844,6 +17843,7 @@ main ()
 
struct sockaddr_in6 sin6;
struct in6_addr in6;
struct in6_pktinfo in6_pi;
in6 = in6addr_any;
in6 = in6addr_loopback;
sin6.sin6_scope_id = 0;
......@@ -17864,36 +17864,6 @@ See \`config.log' for more details" "$LINENO" 5; }
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 <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
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"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5
$as_echo_n "checking for struct sockaddr_storage... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
......@@ -17923,8 +17893,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
......
......@@ -1945,6 +1945,7 @@ AC_COMPILE_IFELSE(
[[
struct sockaddr_in6 sin6;
struct in6_addr in6;
struct in6_pktinfo in6_pi;
in6 = in6addr_any;
in6 = in6addr_loopback;
sin6.sin6_scope_id = 0;
......@@ -1953,22 +1954,6 @@ AC_COMPILE_IFELSE(
[AC_MSG_RESULT([yes])],
[AC_MSG_FAILURE([IPv6 support is mandatory])])
AC_MSG_CHECKING([for in6_pktinfo])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#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"])
AC_MSG_CHECKING(for struct sockaddr_storage)
AC_TRY_COMPILE([
#include <sys/types.h>
......@@ -1980,7 +1965,6 @@ ISC_PLATFORM_HAVESOCKADDRSTORAGE="#define ISC_PLATFORM_HAVESOCKADDRSTORAGE 1"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_HAVESOCKADDRSTORAGE="#undef ISC_PLATFORM_HAVESOCKADDRSTORAGE"])
AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
AC_SUBST(ISC_PLATFORM_HAVESOCKADDRSTORAGE)
AC_MSG_CHECKING([for struct if_laddrreq])
......
......@@ -36,12 +36,6 @@
*/
@ISC_PLATFORM_HAVESALEN@
/*! \brief
* If this system has in6_pktinfo, ISC_PLATFORM_HAVEIN6PKTINFO will be
* defined.
*/
@ISC_PLATFORM_HAVEIN6PKTINFO@
/*! \brief
* If this system needs inet_ntop(), ISC_PLATFORM_NEEDNTOP will be defined.
*/
......
......@@ -158,15 +158,6 @@
#define INADDR_LOOPBACK 0x7f000001UL
#endif
#ifndef ISC_PLATFORM_HAVEIN6PKTINFO
/*% IPv6 packet info */
struct in6_pktinfo {
struct in6_addr ipi6_addr; /*%< src/dst IPv6 address */
unsigned int ipi6_ifindex; /*%< send/recv interface index */
};
#endif
#ifndef ISC_PLATFORM_HAVESOCKADDRSTORAGE
#define _SS_MAXSIZE 128
#define _SS_ALIGNSIZE (sizeof (uint64_t))
......
......@@ -94,10 +94,7 @@
#endif /* HAVE_SYSCTLBYNAME */
static isc_once_t once_ipv6only = ISC_ONCE_INIT;
#if defined(ISC_PLATFORM_HAVEIN6PKTINFO)
static isc_once_t once_ipv6pktinfo = ISC_ONCE_INIT;
#endif
#ifndef ISC_CMSG_IP_TOS
#ifdef __APPLE__
......@@ -152,7 +149,6 @@ try_proto(int domain) {
}
}
#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
if (domain == PF_INET6) {
struct sockaddr_in6 sin6;
unsigned int len;
......@@ -190,7 +186,6 @@ try_proto(int domain) {
}
}
}
#endif
(void)close(s);
......@@ -200,9 +195,7 @@ try_proto(int domain) {
static void
initialize_action(void) {
ipv4_result = try_proto(PF_INET);
#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
ipv6_result = try_proto(PF_INET6);
#endif
#ifdef ISC_PLATFORM_HAVESYSUNH
unix_result = try_proto(PF_UNIX);
#endif
......@@ -307,7 +300,6 @@ initialize_ipv6only(void) {
try_ipv6only) == ISC_R_SUCCESS);
}
#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
static void
try_ipv6pktinfo(void) {
int s, on;
......@@ -359,7 +351,6 @@ initialize_ipv6pktinfo(void) {
RUNTIME_CHECK(isc_once_do(&once_ipv6pktinfo,
try_ipv6pktinfo) == ISC_R_SUCCESS);
}
#endif /* ISC_PLATFORM_HAVEIN6PKTINFO */
isc_result_t
isc_net_probe_ipv6only(void) {
......@@ -369,9 +360,7 @@ isc_net_probe_ipv6only(void) {
isc_result_t
isc_net_probe_ipv6pktinfo(void) {
#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
initialize_ipv6pktinfo();
#endif
return (ipv6pktinfo_result);
}
......
......@@ -259,11 +259,9 @@ typedef isc_event_t intev_t;
* to collect the destination address and interface so the client can
* set them on outgoing packets.
*/
#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
#ifndef USE_CMSG
#define USE_CMSG 1
#endif
#endif
/*%
* NetBSD and FreeBSD can timestamp packets. XXXMLG Should we have
......@@ -295,7 +293,7 @@ typedef isc_event_t intev_t;
* multiplied by 2, everything should fit. Those sizes are not
* large enough to cause any concern.
*/
#if defined(USE_CMSG) && defined(ISC_PLATFORM_HAVEIN6PKTINFO)
#if defined(USE_CMSG)
#define CMSG_SP_IN6PKT 40
#else
#define CMSG_SP_IN6PKT 0
......@@ -1249,9 +1247,7 @@ process_cmsg(isc__socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) {
#ifdef ISC_NET_BSD44MSGHDR
#ifdef USE_CMSG
struct cmsghdr *cmsgp;
#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
struct in6_pktinfo *pktinfop;
#endif
#ifdef SO_TIMESTAMP
void *timevalp;
#endif
......@@ -1289,9 +1285,7 @@ process_cmsg(isc__socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) {
#ifdef SO_TIMESTAMP
timevalp = NULL;
#endif
#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
pktinfop = NULL;
#endif
cmsgp = CMSG_FIRSTHDR(msg);
while (cmsgp != NULL) {
......@@ -1299,7 +1293,6 @@ process_cmsg(isc__socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) {
isc_msgcat, ISC_MSGSET_SOCKET, ISC_MSG_PROCESSCMSG,
"processing cmsg %p", cmsgp);
#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
if (cmsgp->cmsg_level == IPPROTO_IPV6
&& cmsgp->cmsg_type == IPV6_PKTINFO) {
......@@ -1316,7 +1309,6 @@ process_cmsg(isc__socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) {
dev->attributes |= ISC_SOCKEVENTATTR_MULTICAST;
goto next;
}
#endif
#ifdef SO_TIMESTAMP
if (cmsgp->cmsg_level == SOL_SOCKET
......@@ -1454,7 +1446,6 @@ build_msghdr_send(isc__socket_t *sock, char* cmsgbuf, isc_socketevent_t *dev,
msg->msg_flags = 0;
#if defined(USE_CMSG)
#if defined(ISC_PLATFORM_HAVEIN6PKTINFO)
if ((sock->type == isc_sockettype_udp) &&
((dev->attributes & ISC_SOCKEVENTATTR_PKTINFO) != 0))
{
......@@ -1476,7 +1467,6 @@ build_msghdr_send(isc__socket_t *sock, char* cmsgbuf, isc_socketevent_t *dev,
pktinfop = (struct in6_pktinfo *)CMSG_DATA(cmsgp);
memmove(pktinfop, &dev->pktinfo, sizeof(struct in6_pktinfo));
}
#endif
#if defined(IPV6_USE_MIN_MTU)
if ((sock->type == isc_sockettype_udp) &&
......@@ -2671,7 +2661,6 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
}
#endif /* SO_TIMESTAMP */
#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
#ifdef IPV6_RECVPKTINFO
/* RFC 3542 */
if ((sock->pf == AF_INET6)
......@@ -2703,7 +2692,6 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock,
strbuf);
}
#endif /* IPV6_RECVPKTINFO */
#endif /* ISC_PLATFORM_HAVEIN6PKTINFO */
#if defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DONT)
/*
* Turn off Path MTU discovery on IPv6/UDP sockets.
......
......@@ -100,13 +100,6 @@
#define INADDR_LOOPBACK 0x7f000001UL
#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
#if _MSC_VER < 1300
#define in6addr_any isc_in6addr_any
#define in6addr_loopback isc_in6addr_loopback
......
......@@ -42,9 +42,6 @@
#define PATH_MAX _MAX_PATH
#endif
#if _MSC_VER > 1200
#define ISC_PLATFORM_HAVEIN6PKTINFO
#endif
#define ISC_PLATFORM_NEEDPORTT
#undef MSG_TRUNC
#define ISC_PLATFORM_NEEDNTOP
......
......@@ -86,9 +86,7 @@ static void
initialize_action(void) {
InitSockets();
ipv4_result = try_proto(PF_INET);
#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
ipv6_result = try_proto(PF_INET6);
#endif
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment