Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
BIND
Commits
41f5cf4a
Commit
41f5cf4a
authored
Nov 26, 2002
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check for the existance of if_nametoindex().
developer: jinmei reviewer: marka
parent
aebe37a4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
189 additions
and
4 deletions
+189
-4
configure
configure
+152
-1
configure.in
configure.in
+26
-1
lib/isc/include/isc/platform.h.in
lib/isc/include/isc/platform.h.in
+6
-1
lib/isc/netscope.c
lib/isc/netscope.c
+5
-1
No files found.
configure
View file @
41f5cf4a
#! /bin/sh
# From configure.in Revision: 1.33
2
.
# From configure.in Revision: 1.33
3
.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53.
#
...
...
@@ -13206,6 +13206,156 @@ _ACEOF
;;
esac
#
# Check for if_nametoindex() for IPv6 scoped addresses support
#
echo
"
$as_me
:
$LINENO
: checking for if_nametoindex"
>
&5
echo
$ECHO_N
"checking for if_nametoindex...
$ECHO_C
"
>
&6
if
test
"
${
ac_cv_func_if_nametoindex
+set
}
"
=
set
;
then
echo
$ECHO_N
"(cached)
$ECHO_C
"
>
&6
else
cat
>
conftest.
$ac_ext
<<
_ACEOF
#line
$LINENO
"configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char if_nametoindex (); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char if_nametoindex ();
char (*f) ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_if_nametoindex) || defined (__stub___if_nametoindex)
choke me
#else
f = if_nametoindex;
#endif
;
return 0;
}
_ACEOF
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
if
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_link
\"
"
)
>
&5
(
eval
$ac_link
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
&&
{
ac_try
=
'test -s conftest$ac_exeext'
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_try
\"
"
)
>
&5
(
eval
$ac_try
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
;
}
;
then
ac_cv_func_if_nametoindex
=
yes
else
echo
"
$as_me
: failed program was:"
>
&5
cat
conftest.
$ac_ext
>
&5
ac_cv_func_if_nametoindex
=
no
fi
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
conftest.
$ac_ext
fi
echo
"
$as_me
:
$LINENO
: result:
$ac_cv_func_if_nametoindex
"
>
&5
echo
"
${
ECHO_T
}
$ac_cv_func_if_nametoindex
"
>
&6
if
test
$ac_cv_func_if_nametoindex
=
yes
;
then
ac_cv_have_if_nametoindex
=
yes
else
ac_cv_have_if_nametoindex
=
no
fi
case
$ac_cv_have_if_nametoindex
in
no
)
case
"
$host
"
in
*
-hp-hpux
*
)
echo
"
$as_me
:
$LINENO
: checking for if_nametoindex in -lipv6"
>
&5
echo
$ECHO_N
"checking for if_nametoindex in -lipv6...
$ECHO_C
"
>
&6
if
test
"
${
ac_cv_lib_ipv6_if_nametoindex
+set
}
"
=
set
;
then
echo
$ECHO_N
"(cached)
$ECHO_C
"
>
&6
else
ac_check_lib_save_LIBS
=
$LIBS
LIBS
=
"-lipv6
$LIBS
"
cat
>
conftest.
$ac_ext
<<
_ACEOF
#line
$LINENO
"configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char if_nametoindex ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
if_nametoindex ();
;
return 0;
}
_ACEOF
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
if
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_link
\"
"
)
>
&5
(
eval
$ac_link
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
&&
{
ac_try
=
'test -s conftest$ac_exeext'
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_try
\"
"
)
>
&5
(
eval
$ac_try
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
;
}
;
then
ac_cv_lib_ipv6_if_nametoindex
=
yes
else
echo
"
$as_me
: failed program was:"
>
&5
cat
conftest.
$ac_ext
>
&5
ac_cv_lib_ipv6_if_nametoindex
=
no
fi
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
conftest.
$ac_ext
LIBS
=
$ac_check_lib_save_LIBS
fi
echo
"
$as_me
:
$LINENO
: result:
$ac_cv_lib_ipv6_if_nametoindex
"
>
&5
echo
"
${
ECHO_T
}
$ac_cv_lib_ipv6_if_nametoindex
"
>
&6
if
test
$ac_cv_lib_ipv6_if_nametoindex
=
yes
;
then
ac_cv_have_if_nametoindex
=
yes
LIBS
=
"-lipv6
$LIBS
"
fi
;;
esac
esac
case
$ac_cv_have_if_nametoindex
in
yes
)
ISC_PLATFORM_HAVEIFNAMETOINDEX
=
"#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
;;
*
)
ISC_PLATFORM_HAVEIFNAMETOINDEX
=
"#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
;;
esac
#
# The following sections deal with tools used for formatting
# the documentation. They are all optional, unless you are
...
...
@@ -14360,6 +14510,7 @@ s,@ISC_PLATFORM_RLIMITTYPE@,$ISC_PLATFORM_RLIMITTYPE,;t t
s,@ISC_PLATFORM_USEDECLSPEC@,
$ISC_PLATFORM_USEDECLSPEC
,;t t
s,@LWRES_PLATFORM_USEDECLSPEC@,
$LWRES_PLATFORM_USEDECLSPEC
,;t t
s,@ISC_PLATFORM_BRACEPTHREADONCEINIT@,
$ISC_PLATFORM_BRACEPTHREADONCEINIT
,;t t
s,@ISC_PLATFORM_HAVEIFNAMETOINDEX@,
$ISC_PLATFORM_HAVEIFNAMETOINDEX
,;t t
s,@OPENJADE@,
$OPENJADE
,;t t
s,@JADETEX@,
$JADETEX
,;t t
s,@PDFJADETEX@,
$PDFJADETEX
,;t t
...
...
configure.in
View file @
41f5cf4a
...
...
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl
AC_REVISION($Revision: 1.33
2
$)
AC_REVISION($Revision: 1.33
3
$)
AC_INIT(lib/dns/name.c)
AC_PREREQ(2.13)
...
...
@@ -1690,6 +1690,31 @@ case "$hack_shutup_stdargcast" in
;;
esac
#
# 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
no)
case "$host" in
*-hp-hpux*)
AC_CHECK_LIB(ipv6, if_nametoindex,
ac_cv_have_if_nametoindex=yes
LIBS="-lipv6 $LIBS",)
;;
esac
esac
case $ac_cv_have_if_nametoindex in
yes)
ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
;;
*)
ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
;;
esac
AC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
#
# The following sections deal with tools used for formatting
# the documentation. They are all optional, unless you are
...
...
lib/isc/include/isc/platform.h.in
View file @
41f5cf4a
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: platform.h.in,v 1.
29
2002/1
0
/2
4
03:5
2:34
marka Exp $ */
/* $Id: platform.h.in,v 1.
30
2002/1
1
/2
6
03:5
0:07
marka Exp $ */
#ifndef ISC_PLATFORM_H
#define ISC_PLATFORM_H 1
...
...
@@ -180,6 +180,11 @@
*/
@ISC_PLATFORM_USEDECLSPEC@
/*
* Define if the system supports if_nametoindex.
*/
@ISC_PLATFORM_HAVEIFNAMETOINDEX@
#ifndef ISC_PLATFORM_USEDECLSPEC
#define LIBISC_EXTERNAL_DATA
#define LIBDNS_EXTERNAL_DATA
...
...
lib/isc/netscope.c
View file @
41f5cf4a
...
...
@@ -17,7 +17,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static
char
rcsid
[]
=
"$Id: netscope.c,v 1.
3
2002/1
0
/2
8
0
2:23:53
marka Exp $"
;
"$Id: netscope.c,v 1.
4
2002/1
1
/2
6
0
3:50:07
marka Exp $"
;
#endif
/* LIBC_SCCS and not lint */
#include <isc/string.h>
...
...
@@ -47,10 +47,12 @@ isc_netscope_pton(int af, char *scopename, char *addr, isc_uint32_t *zoneid) {
* interface names as link names, assuming one to one mapping between
* interfaces and links.
*/
#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
if
(
IN6_IS_ADDR_LINKLOCAL
(
in6
)
&&
(
ifid
=
if_nametoindex
((
const
char
*
)
scopename
))
!=
0
)
zone
=
(
isc_uint32_t
)
ifid
;
else
{
#endif
llz
=
isc_string_touint64
(
scopename
,
&
ep
,
10
);
if
(
ep
==
scopename
)
return
(
ISC_R_FAILURE
);
...
...
@@ -59,7 +61,9 @@ isc_netscope_pton(int af, char *scopename, char *addr, isc_uint32_t *zoneid) {
zone
=
(
isc_uint32_t
)(
llz
&
0xffffffffUL
);
if
(
zone
!=
llz
)
return
(
ISC_R_FAILURE
);
#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX
}
#endif
*
zoneid
=
zone
;
return
(
ISC_R_SUCCESS
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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