]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove support for legacy systems without in6_pktinfo
authorOndřej Surý <ondrej@sury.org>
Tue, 21 Aug 2018 11:22:40 +0000 (13:22 +0200)
committerOndřej Surý <ondrej@sury.org>
Tue, 28 Aug 2018 08:31:48 +0000 (10:31 +0200)
configure
configure.in
lib/isc/include/isc/platform.h.in
lib/isc/unix/include/isc/net.h
lib/isc/unix/net.c
lib/isc/unix/socket.c
lib/isc/win32/include/isc/net.h
lib/isc/win32/include/isc/platform.h.in
lib/isc/win32/net.c

index 6e542c0872e9975102f6b5aef7bd2215baffafd2..c219bf1b17912d35459fcdd790144829a18e2a15 100755 (executable)
--- a/configure
+++ b/configure
@@ -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
index 4b0d64265906004abd83ef54628f4abec59a3b46..98e327a584ba04532fe1c7a73d2c7f39e3963ee3 100644 (file)
@@ -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])
index b788f252634f92d38fd8efb115340ae8cc6912fc..3db6b55f876e98975401b9aa603a396bf925434b 100644 (file)
  */
 @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.
  */
index 744c9d6fadb7dc4406a6dbe09f541eeb3c4c6fb9..09fcfa8e0cad15ab92aa58d9e72b3ea325895b62 100644 (file)
 #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))
index f46d9b0c860284dab1ab1ec95fe4ff78a088aba9..60c3f0c42b6a1addc19a9f39ddcda07cda68f86e 100644 (file)
 #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);
 }
 
index 2fc4da95c09c33adfddcc8bd911ae4ab8bc1a062..526f7ff8da9ee6fbd69d5e6b08f0353fd64b9109 100644 (file)
@@ -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.
index 8494bcccb132831d0e7a9ceaa9be44a7969f6740..85c424976f4314f7d85e02c12efef9c9d699e911 100644 (file)
 #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
index 80c0a7a3c027174ae8a5d8c3d84cc3f9fe0dc581..4be866fe99700bff0b1fe73015311a7f1e4ce7bb 100644 (file)
@@ -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
index 3ea4de3e2678026b0052409662f1db5ce71158d1..2b536aae7d4369d28ab42a1834513ae20d848078 100644 (file)
@@ -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