mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 08:22:04 -04:00
Remove support for legacy systems without sin6_scope_id
This commit is contained in:
parent
4150a86046
commit
8c526df306
9 changed files with 3 additions and 81 deletions
33
configure
vendored
33
configure
vendored
|
|
@ -747,7 +747,6 @@ ISC_PLATFORM_NEEDPTON
|
|||
ISC_PLATFORM_NEEDNTOP
|
||||
ISC_PLATFORM_HAVEIF_LADDRCONF
|
||||
ISC_PLATFORM_HAVEIF_LADDRREQ
|
||||
ISC_PLATFORM_HAVESCOPEID
|
||||
ISC_PLATFORM_HAVESOCKADDRSTORAGE
|
||||
ISC_PLATFORM_HAVEIN6PKTINFO
|
||||
BIND9_CO_RULE
|
||||
|
|
@ -17847,6 +17846,7 @@ main ()
|
|||
struct in6_addr in6;
|
||||
in6 = in6addr_any;
|
||||
in6 = in6addr_loopback;
|
||||
sin6.sin6_scope_id = 0;
|
||||
return (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 sin6_scope_id in struct sockaddr_in6" >&5
|
||||
$as_echo_n "checking for sin6_scope_id in struct sockaddr_in6... " >&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 sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; 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_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
|
||||
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
|
||||
|
|
@ -17955,7 +17925,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
|
||||
|
|
|
|||
18
configure.in
18
configure.in
|
|
@ -1947,27 +1947,12 @@ AC_COMPILE_IFELSE(
|
|||
struct in6_addr in6;
|
||||
in6 = in6addr_any;
|
||||
in6 = in6addr_loopback;
|
||||
sin6.sin6_scope_id = 0;
|
||||
return (0);
|
||||
]])],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_FAILURE([IPv6 support is mandatory])])
|
||||
|
||||
AC_MSG_CHECKING([for sin6_scope_id in struct sockaddr_in6])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
]],
|
||||
[[
|
||||
struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);
|
||||
]])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"],
|
||||
[AC_MSG_RESULT([no])
|
||||
ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"])
|
||||
|
||||
AC_MSG_CHECKING([for in6_pktinfo])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
|
|
@ -1997,7 +1982,6 @@ ISC_PLATFORM_HAVESOCKADDRSTORAGE="#undef ISC_PLATFORM_HAVESOCKADDRSTORAGE"])
|
|||
|
||||
AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
|
||||
AC_SUBST(ISC_PLATFORM_HAVESOCKADDRSTORAGE)
|
||||
AC_SUBST(ISC_PLATFORM_HAVESCOPEID)
|
||||
|
||||
AC_MSG_CHECKING([for struct if_laddrreq])
|
||||
AC_TRY_LINK([
|
||||
|
|
|
|||
|
|
@ -98,7 +98,6 @@ bind9_getaddresses(const char *hostname, in_port_t port,
|
|||
return (ISC_R_FAMILYNOSUPPORT);
|
||||
|
||||
if (d != NULL) {
|
||||
#ifdef ISC_PLATFORM_HAVESCOPEID
|
||||
isc_result_t iresult;
|
||||
|
||||
iresult = isc_netscope_pton(AF_INET6, d + 1,
|
||||
|
|
@ -106,15 +105,6 @@ bind9_getaddresses(const char *hostname, in_port_t port,
|
|||
|
||||
if (iresult != ISC_R_SUCCESS)
|
||||
return (iresult);
|
||||
#else
|
||||
/*
|
||||
* The extended format is specified while the
|
||||
* system does not provide the ability to use
|
||||
* it. Throw an explicit error instead of
|
||||
* ignoring the specified value.
|
||||
*/
|
||||
return (ISC_R_BADADDRESSFORM);
|
||||
#endif
|
||||
}
|
||||
|
||||
isc_netaddr_fromin6(&na, &in6);
|
||||
|
|
|
|||
|
|
@ -42,11 +42,6 @@
|
|||
*/
|
||||
@ISC_PLATFORM_HAVEIN6PKTINFO@
|
||||
|
||||
/*! \brief
|
||||
* If this system has sin6_scope_id, ISC_PLATFORM_HAVESCOPEID will be defined.
|
||||
*/
|
||||
@ISC_PLATFORM_HAVESCOPEID@
|
||||
|
||||
/*! \brief
|
||||
* If this system needs inet_ntop(), ISC_PLATFORM_NEEDNTOP will be defined.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -336,11 +336,7 @@ isc_netaddr_fromsockaddr(isc_netaddr_t *t, const isc_sockaddr_t *s) {
|
|||
break;
|
||||
case AF_INET6:
|
||||
memmove(&t->type.in6, &s->type.sin6.sin6_addr, 16);
|
||||
#ifdef ISC_PLATFORM_HAVESCOPEID
|
||||
t->zone = s->type.sin6.sin6_scope_id;
|
||||
#else
|
||||
t->zone = 0;
|
||||
#endif
|
||||
break;
|
||||
#ifdef ISC_PLATFORM_HAVESYSUNH
|
||||
case AF_UNIX:
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ isc_sockaddr_compare(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
|
|||
memcmp(&a->type.sin6.sin6_addr, &b->type.sin6.sin6_addr,
|
||||
sizeof(a->type.sin6.sin6_addr)) != 0)
|
||||
return (false);
|
||||
#ifdef ISC_PLATFORM_HAVESCOPEID
|
||||
/*
|
||||
* If ISC_SOCKADDR_CMPSCOPEZERO is set then don't return
|
||||
* false if one of the scopes in zero.
|
||||
|
|
@ -82,7 +81,6 @@ isc_sockaddr_compare(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
|
|||
(a->type.sin6.sin6_scope_id != 0 &&
|
||||
b->type.sin6.sin6_scope_id != 0)))
|
||||
return (false);
|
||||
#endif
|
||||
if ((flags & ISC_SOCKADDR_CMPPORT) != 0 &&
|
||||
a->type.sin6.sin6_port != b->type.sin6.sin6_port)
|
||||
return (false);
|
||||
|
|
@ -377,9 +375,7 @@ isc_sockaddr_fromnetaddr(isc_sockaddr_t *sockaddr, const isc_netaddr_t *na,
|
|||
sockaddr->type.sin6.sin6_len = sizeof(sockaddr->type.sin6);
|
||||
#endif
|
||||
memmove(&sockaddr->type.sin6.sin6_addr, &na->type.in6, 16);
|
||||
#ifdef ISC_PLATFORM_HAVESCOPEID
|
||||
sockaddr->type.sin6.sin6_scope_id = isc_netaddr_getzone(na);
|
||||
#endif
|
||||
sockaddr->type.sin6.sin6_port = htons(port);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -62,8 +62,7 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src,
|
|||
{
|
||||
struct sockaddr_in6 *sa6;
|
||||
|
||||
#if !defined(ISC_PLATFORM_HAVEIFNAMETOINDEX) || \
|
||||
!defined(ISC_PLATFORM_HAVESCOPEID)
|
||||
#if !defined(ISC_PLATFORM_HAVEIFNAMETOINDEX)
|
||||
UNUSED(ifname);
|
||||
#endif
|
||||
|
||||
|
|
@ -81,7 +80,6 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src,
|
|||
sa6 = (struct sockaddr_in6 *)src;
|
||||
memmove(&dst->type.in6, &sa6->sin6_addr,
|
||||
sizeof(struct in6_addr));
|
||||
#ifdef ISC_PLATFORM_HAVESCOPEID
|
||||
if (sa6->sin6_scope_id != 0)
|
||||
isc_netaddr_setzone(dst, sa6->sin6_scope_id);
|
||||
else {
|
||||
|
|
@ -127,7 +125,6 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src,
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
INSIST(0);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@
|
|||
#if _MSC_VER > 1200
|
||||
#define ISC_PLATFORM_HAVEIN6PKTINFO
|
||||
#endif
|
||||
#define ISC_PLATFORM_HAVESCOPEID
|
||||
#define ISC_PLATFORM_NEEDPORTT
|
||||
#undef MSG_TRUNC
|
||||
#define ISC_PLATFORM_NEEDNTOP
|
||||
|
|
|
|||
|
|
@ -2336,7 +2336,6 @@ token_addr(cfg_parser_t *pctx, unsigned int flags, isc_netaddr_t *na) {
|
|||
|
||||
if (inet_pton(AF_INET6, buf, &in6a) == 1) {
|
||||
if (d != NULL) {
|
||||
#ifdef ISC_PLATFORM_HAVESCOPEID
|
||||
isc_result_t result;
|
||||
|
||||
result = isc_netscope_pton(AF_INET6,
|
||||
|
|
@ -2345,9 +2344,6 @@ token_addr(cfg_parser_t *pctx, unsigned int flags, isc_netaddr_t *na) {
|
|||
&zone);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
#else
|
||||
return (ISC_R_BADADDRESSFORM);
|
||||
#endif
|
||||
}
|
||||
|
||||
isc_netaddr_fromin6(na, &in6a);
|
||||
|
|
|
|||
Loading…
Reference in a new issue