Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
0bea5c2b
Commit
0bea5c2b
authored
Sep 04, 2018
by
Ondřej Surý
Browse files
Replace platform.h ISC_PLATFORM_HAVEIFNAMETOINDEX with config HAVE_IF_NAMETOINDEX
parent
53d87175
Changes
6
Hide whitespace changes
Inline
Side-by-side
config.h.in
View file @
0bea5c2b
...
...
@@ -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. */
...
...
configure
View file @
0bea5c2b
...
...
@@ -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
...
...
configure.in
View file @
0bea5c2b
...
...
@@ -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)
...
...
lib/isc/include/isc/platform.h.in
View file @
0bea5c2b
...
...
@@ -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.
*/
...
...
lib/isc/netscope.c
View file @
0bea5c2b
...
...
@@ -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
...
...
lib/isc/unix/interfaceiter.c
View file @
0bea5c2b
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment