]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Replace platform.h ISC_PLATFORM_HAVEIFNAMETOINDEX with config HAVE_IF_NAMETOINDEX
authorOndřej Surý <ondrej@sury.org>
Tue, 4 Sep 2018 10:35:42 +0000 (12:35 +0200)
committerOndřej Surý <ondrej@sury.org>
Fri, 7 Sep 2018 10:17:30 +0000 (12:17 +0200)
config.h.in
configure
configure.in
lib/isc/include/isc/platform.h.in
lib/isc/netscope.c
lib/isc/unix/interfaceiter.c

index 65844b472f00d4953dccd74ca311f4c4e37cab2e..83a1e8a99e4b34d47fd30d2815f1cf1c20457eec 100644 (file)
 /* Define to 1 if you have the <idn2.h> header file. */
 #undef HAVE_IDN2_H
 
-/* Define to 1 if you have the if_nametoindex function. */
+/* Define to 1 if you have the `if_nametoindex' function. */
 #undef HAVE_IF_NAMETOINDEX
 
 /* Define to 1 if you have the <inttypes.h> header file. */
index 121f37f778ff875fe1ffe9e7a043e4d4f73b1ff6..53ab9f8d13632035f8df73c1e0e3899b50ea4237 100755 (executable)
--- a/configure
+++ b/configure
@@ -706,7 +706,6 @@ DNSTAPSRCS
 DNSTAP
 FSTRM_CAPTURE
 PROTOC_C
-ISC_PLATFORM_HAVEIFNAMETOINDEX
 ISC_PLATFORM_HAVESTRINGSH
 IRS_PLATFORM_USEDECLSPEC
 ISC_PLATFORM_USEDECLSPEC
@@ -18157,24 +18156,16 @@ done
 #
 # Check for if_nametoindex() for IPv6 scoped addresses support
 #
-ac_fn_c_check_func "$LINENO" "if_nametoindex" "ac_cv_func_if_nametoindex"
+for ac_func in if_nametoindex
+do :
+  ac_fn_c_check_func "$LINENO" "if_nametoindex" "ac_cv_func_if_nametoindex"
 if test "x$ac_cv_func_if_nametoindex" = xyes; then :
-  ac_cv_have_if_nametoindex=yes
-else
-  ac_cv_have_if_nametoindex=no
-fi
-
-case $ac_cv_have_if_nametoindex in
-yes)
-       ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
-
-$as_echo "#define HAVE_IF_NAMETOINDEX 1" >>confdefs.h
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_IF_NAMETOINDEX 1
+_ACEOF
 
-       ;;
-*)
-       ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
-       ;;
-esac
+fi
+done
 
 
 for ac_func in nanosleep usleep explicit_bzero
index b490c9a43dd310ab8273145d45e6e00817192909..87e1d6efb6ac6cc542f53957467a4f9efadc38c8 100644 (file)
@@ -2154,19 +2154,7 @@ AC_SUBST(ISC_PLATFORM_HAVESTRINGSH)
 #
 # Check for if_nametoindex() for IPv6 scoped addresses support
 #
-AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
-               ac_cv_have_if_nametoindex=no)
-case $ac_cv_have_if_nametoindex in
-yes)
-       ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
-       AC_DEFINE(HAVE_IF_NAMETOINDEX, 1,
-       [Define to 1 if you have the if_nametoindex function.])
-       ;;
-*)
-       ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
-       ;;
-esac
-AC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
+AC_CHECK_FUNCS([if_nametoindex])
 
 AC_CHECK_FUNCS(nanosleep usleep explicit_bzero)
 
index 7609253e8114428283fbd8019f12447709581a70..05fe3071bf3582d4e4ae8c242bb5b8db18084968 100644 (file)
  */
 @ISC_PLATFORM_HAVELIFCONF@
 
-/*! \brief
- * Define if the system supports if_nametoindex.
- */
-@ISC_PLATFORM_HAVEIFNAMETOINDEX@
-
 /*! \brief
  * Define if the system has TCP_FASTOPEN socket option.
  */
index 7fed44ecc101f51c087f26435da3504922724432..da0046398a69553269a53e278de87ca4bc0ae227 100644 (file)
@@ -24,7 +24,7 @@
 isc_result_t
 isc_netscope_pton(int af, char *scopename, void *addr, uint32_t *zoneid) {
        char *ep;
-#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
+#ifdef HAVE_IF_NAMETOINDEX
        unsigned int ifid;
        struct in6_addr *in6;
 #endif
@@ -43,7 +43,7 @@ isc_netscope_pton(int af, char *scopename, void *addr, uint32_t *zoneid) {
         * interface names as link names, assuming one to one mapping between
         * interfaces and links.
         */
-#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
+#ifdef HAVE_IF_NAMETOINDEX
        in6 = (struct in6_addr *)addr;
        if (IN6_IS_ADDR_LINKLOCAL(in6) &&
            (ifid = if_nametoindex((const char *)scopename)) != 0)
@@ -58,7 +58,7 @@ isc_netscope_pton(int af, char *scopename, void *addr, uint32_t *zoneid) {
                zone = (uint32_t)(llz & 0xffffffffUL);
                if (zone != llz)
                        return (ISC_R_FAILURE);
-#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
+#ifdef HAVE_IF_NAMETOINDEX
        }
 #endif
 
index 0e7712a77e7508761e9142842cfbecdcf3f075b0..3f0f1053c20237f736614633b977ffb913b24ab6 100644 (file)
@@ -62,7 +62,7 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src,
 {
        struct sockaddr_in6 *sa6;
 
-#if !defined(ISC_PLATFORM_HAVEIFNAMETOINDEX)
+#if !defined(HAVE_IF_NAMETOINDEX)
        UNUSED(ifname);
 #endif
 
@@ -106,7 +106,7 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src,
                                                            (uint32_t)zone16);
                                        dst->type.in6.s6_addr[2] = 0;
                                        dst->type.in6.s6_addr[3] = 0;
-#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
+#ifdef HAVE_IF_NAMETOINDEX
                                } else if (ifname != NULL) {
                                        unsigned int zone;