Commit 0bea5c2b authored by Ondřej Surý's avatar Ondřej Surý

Replace platform.h ISC_PLATFORM_HAVEIFNAMETOINDEX with config HAVE_IF_NAMETOINDEX

parent 53d87175
......@@ -251,7 +251,7 @@
/* 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. */
......
......@@ -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
......
......@@ -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)
......
......@@ -42,11 +42,6 @@
*/
@ISC_PLATFORM_HAVELIFCONF@
/*! \brief
* Define if the system supports if_nametoindex.
*/
@ISC_PLATFORM_HAVEIFNAMETOINDEX@
/*! \brief
* Define if the system has TCP_FASTOPEN socket option.
*/
......
......@@ -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
......
......@@ -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;
......
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