2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 15:05:23 +00:00

4025. [port] bsdi: failed to build. [RT #38047]

This commit is contained in:
Mark Andrews
2014-12-19 12:06:35 +11:00
parent d5ece58e3b
commit d8f2dd46cb
14 changed files with 241 additions and 59 deletions

View File

@@ -1,3 +1,5 @@
4025. [port] bsdi: failed to build. [RT #38047]
4024. [bug] dns_rdata_opt_first, dns_rdata_opt_next, 4024. [bug] dns_rdata_opt_first, dns_rdata_opt_next,
dns_rdata_opt_current, dns_rdata_txt_first, dns_rdata_opt_current, dns_rdata_txt_first,
dns_rdata_txt_next and dns_rdata_txt_current were dns_rdata_txt_next and dns_rdata_txt_current were

View File

@@ -221,6 +221,12 @@ int sigwait(const unsigned int *set, int *sig);
/* Define to 1 if you have the <fcntl.h> header file. */ /* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H #undef HAVE_FCNTL_H
/* Define to 1 if you have the `fseeko' function. */
#undef HAVE_FSEEKO
/* Define to 1 if you have the `ftello' function. */
#undef HAVE_FTELLO
/* Build with GeoIP support */ /* Build with GeoIP support */
#undef HAVE_GEOIP #undef HAVE_GEOIP
@@ -464,6 +470,9 @@ int sigwait(const unsigned int *set, int *sig);
/* Define to the flags type used by getnameinfo(3). */ /* Define to the flags type used by getnameinfo(3). */
#undef IRS_GETNAMEINFO_FLAGS_T #undef IRS_GETNAMEINFO_FLAGS_T
/* Define to the sockaddr length type used by getnameinfo(3). */
#undef IRS_GETNAMEINFO_SOCKLEN_T
/* Define to allow building of objects for dlopen(). */ /* Define to allow building of objects for dlopen(). */
#undef ISC_DLZ_DLOPEN #undef ISC_DLZ_DLOPEN

80
configure vendored
View File

@@ -768,6 +768,7 @@ ISC_IPV6_C
ISC_ISCIPV6_O ISC_ISCIPV6_O
ISC_IPV6_O ISC_IPV6_O
ISC_IPV6_H ISC_IPV6_H
ISC_PLATFORM_HAVESOCKADDRSTORAGE
ISC_PLATFORM_FIXIN6ISADDR ISC_PLATFORM_FIXIN6ISADDR
ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_HAVEIN6PKTINFO
LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK
@@ -13028,6 +13029,20 @@ fi
done done
# BSDI doesn't have ftello fseeko
for ac_func in ftello fseeko
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
# #
# UnixWare 7.1.1 with the feature supplement to the UDK compiler # UnixWare 7.1.1 with the feature supplement to the UDK compiler
# is reported to not support "static inline" (RT #1212). # is reported to not support "static inline" (RT #1212).
@@ -17608,6 +17623,36 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;; ;;
esac esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5
$as_echo_n "checking for struct sockaddr_storage... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/socket.h>
$isc_netinetin6_hack
$isc_netinet6in6_hack
int
main ()
{
struct sockaddr_storage storage; 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_HAVESOCKADDRSTORAGE="#define ISC_PLATFORM_HAVESOCKADDRSTORAGE 1"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
ISC_PLATFORM_HAVESOCKADDRSTORAGE="#undef ISC_PLATFORM_HAVESOCKADDRSTORAGE"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -18145,6 +18190,9 @@ if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: socklen_t for buflen; u_int for flags" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: socklen_t for buflen; u_int for flags" >&5
$as_echo "socklen_t for buflen; u_int for flags" >&6; } $as_echo "socklen_t for buflen; u_int for flags" >&6; }
$as_echo "#define IRS_GETNAMEINFO_SOCKLEN_T socklen_t" >>confdefs.h
$as_echo "#define IRS_GETNAMEINFO_BUFLEN_T socklen_t" >>confdefs.h $as_echo "#define IRS_GETNAMEINFO_BUFLEN_T socklen_t" >>confdefs.h
@@ -18170,6 +18218,34 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"; then : if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t for buflen; int for flags" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t for buflen; int for flags" >&5
$as_echo "size_t for buflen; int for flags" >&6; } $as_echo "size_t for buflen; int for flags" >&6; }
$as_echo "#define IRS_GETNAMEINFO_SOCKLEN_T socklen_t" >>confdefs.h
$as_echo "#define IRS_GETNAMEINFO_BUFLEN_T size_t" >>confdefs.h
$as_echo "#define IRS_GETNAMEINFO_FLAGS_T int" >>confdefs.h
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
int getnameinfo(const struct sockaddr *, size_t, char *,
size_t, char *, size_t, int);
int
main ()
{
return (0);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t for buflen; int for flags" >&5
$as_echo "size_t for buflen; int for flags" >&6; }
$as_echo "#define IRS_GETNAMEINFO_SOCKLEN_T size_t" >>confdefs.h
$as_echo "#define IRS_GETNAMEINFO_BUFLEN_T size_t" >>confdefs.h $as_echo "#define IRS_GETNAMEINFO_BUFLEN_T size_t" >>confdefs.h
$as_echo "#define IRS_GETNAMEINFO_FLAGS_T int" >>confdefs.h $as_echo "#define IRS_GETNAMEINFO_FLAGS_T int" >>confdefs.h
@@ -18177,6 +18253,8 @@ $as_echo "size_t for buflen; int for flags" >&6; }
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not match any subspecies; assume standard definition" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: not match any subspecies; assume standard definition" >&5
$as_echo "not match any subspecies; assume standard definition" >&6; } $as_echo "not match any subspecies; assume standard definition" >&6; }
$as_echo "#define IRS_GETNAMEINFO_SOCKLEN_T socklen_t" >>confdefs.h
$as_echo "#define IRS_GETNAMEINFO_BUFLEN_T socklen_t" >>confdefs.h $as_echo "#define IRS_GETNAMEINFO_BUFLEN_T socklen_t" >>confdefs.h
$as_echo "#define IRS_GETNAMEINFO_FLAGS_T int" >>confdefs.h $as_echo "#define IRS_GETNAMEINFO_FLAGS_T int" >>confdefs.h
@@ -18185,6 +18263,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# #
# ...and same for gai_strerror(). # ...and same for gai_strerror().

View File

@@ -486,6 +486,9 @@ AC_CHECK_FUNCS(mmap)
AC_CHECK_FUNCS(seteuid setresuid) AC_CHECK_FUNCS(seteuid setresuid)
AC_CHECK_FUNCS(setegid setresgid) AC_CHECK_FUNCS(setegid setresgid)
# BSDI doesn't have ftello fseeko
AC_CHECK_FUNCS(ftello fseeko)
# #
# UnixWare 7.1.1 with the feature supplement to the UDK compiler # UnixWare 7.1.1 with the feature supplement to the UDK compiler
# is reported to not support "static inline" (RT #1212). # is reported to not support "static inline" (RT #1212).
@@ -2737,6 +2740,19 @@ $isc_netinet6in6_hack
;; ;;
esac esac
AC_MSG_CHECKING(for struct sockaddr_storage)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
$isc_netinetin6_hack
$isc_netinet6in6_hack
],
[struct sockaddr_storage storage; return (0);],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_HAVESOCKADDRSTORAGE="#define ISC_PLATFORM_HAVESOCKADDRSTORAGE 1"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_HAVESOCKADDRSTORAGE="#undef ISC_PLATFORM_HAVESOCKADDRSTORAGE"])
AC_SUBST(ISC_PLATFORM_HAVEIPV6) AC_SUBST(ISC_PLATFORM_HAVEIPV6)
AC_SUBST(LWRES_PLATFORM_HAVEIPV6) AC_SUBST(LWRES_PLATFORM_HAVEIPV6)
AC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H) AC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
@@ -2751,6 +2767,7 @@ AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK) AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO) AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
AC_SUBST(ISC_PLATFORM_FIXIN6ISADDR) AC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
AC_SUBST(ISC_PLATFORM_HAVESOCKADDRSTORAGE)
AC_SUBST(ISC_IPV6_H) AC_SUBST(ISC_IPV6_H)
AC_SUBST(ISC_IPV6_O) AC_SUBST(ISC_IPV6_O)
AC_SUBST(ISC_ISCIPV6_O) AC_SUBST(ISC_ISCIPV6_O)
@@ -3000,6 +3017,8 @@ int getnameinfo(const struct sockaddr *, socklen_t, char *,
socklen_t, char *, socklen_t, unsigned int);], socklen_t, char *, socklen_t, unsigned int);],
[ return (0);], [ return (0);],
[AC_MSG_RESULT(socklen_t for buflen; u_int for flags) [AC_MSG_RESULT(socklen_t for buflen; u_int for flags)
AC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, socklen_t,
[Define to the sockaddr length type used by getnameinfo(3).])
AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t, AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t,
[Define to the buffer length type used by getnameinfo(3).]) [Define to the buffer length type used by getnameinfo(3).])
AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, unsigned int, AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, unsigned int,
@@ -3012,11 +3031,24 @@ int getnameinfo(const struct sockaddr *, socklen_t, char *,
size_t, char *, size_t, int);], size_t, char *, size_t, int);],
[ return (0);], [ return (0);],
[AC_MSG_RESULT(size_t for buflen; int for flags) [AC_MSG_RESULT(size_t for buflen; int for flags)
AC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, socklen_t)
AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, size_t)
AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)],
[AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
int getnameinfo(const struct sockaddr *, size_t, char *,
size_t, char *, size_t, int);],
[ return (0);],
[AC_MSG_RESULT(size_t for buflen; int for flags)
AC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, size_t)
AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, size_t) AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, size_t)
AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)], AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)],
[AC_MSG_RESULT(not match any subspecies; assume standard definition) [AC_MSG_RESULT(not match any subspecies; assume standard definition)
AC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, socklen_t)
AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t) AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, socklen_t)
AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)])]) AC_DEFINE(IRS_GETNAMEINFO_FLAGS_T, int)])])])
# #
# ...and same for gai_strerror(). # ...and same for gai_strerror().

View File

@@ -143,9 +143,10 @@ static struct afd {
} while (0) } while (0)
int int
getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, getnameinfo(const struct sockaddr *sa, IRS_GETNAMEINFO_SOCKLEN_T salen,
IRS_GETNAMEINFO_BUFLEN_T hostlen, char *serv, char *host, IRS_GETNAMEINFO_BUFLEN_T hostlen,
IRS_GETNAMEINFO_BUFLEN_T servlen, IRS_GETNAMEINFO_FLAGS_T flags) char *serv, IRS_GETNAMEINFO_BUFLEN_T servlen,
IRS_GETNAMEINFO_FLAGS_T flags)
{ {
struct afd *afd = NULL; struct afd *afd = NULL;
struct servent *sp; struct servent *sp;

View File

@@ -131,6 +131,11 @@
*/ */
@ISC_PLATFORM_FIXIN6ISADDR@ @ISC_PLATFORM_FIXIN6ISADDR@
/*! \brief
* Define if the system has struct sockaddr_storage.
*/
@ISC_PLATFORM_HAVESOCKADDRSTORAGE@
/*! \brief /*! \brief
* Define if the system supports kqueue multiplexing * Define if the system supports kqueue multiplexing
*/ */

View File

@@ -28,7 +28,7 @@
#include <math.h> #include <math.h>
typedef double (pvalue_func_t)(isc_mem_t *mctx, typedef double (pvalue_func_t)(isc_mem_t *mctx,
uint16_t *values, size_t length); isc_uint16_t *values, size_t length);
/* igamc(), igam(), etc. were adapted (and cleaned up) from the Cephes /* igamc(), igam(), etc. were adapted (and cleaned up) from the Cephes
* math library: * math library:
@@ -138,17 +138,17 @@ igam(double a, double x) {
return (ans * ax / a); return (ans * ax / a);
} }
static int8_t scounts_table[65536]; static isc_int8_t scounts_table[65536];
static uint8_t bitcounts_table[65536]; static isc_uint8_t bitcounts_table[65536];
static int8_t static isc_int8_t
scount_calculate(uint16_t n) { scount_calculate(isc_uint16_t n) {
int i; int i;
int8_t sc; isc_int8_t sc;
sc = 0; sc = 0;
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
uint16_t lsb; isc_uint16_t lsb;
lsb = n & 1; lsb = n & 1;
if (lsb != 0) if (lsb != 0)
@@ -162,14 +162,14 @@ scount_calculate(uint16_t n) {
return (sc); return (sc);
} }
static uint8_t static isc_uint8_t
bitcount_calculate(uint16_t n) { bitcount_calculate(isc_uint16_t n) {
int i; int i;
uint8_t bc; isc_uint8_t bc;
bc = 0; bc = 0;
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
uint16_t lsb; isc_uint16_t lsb;
lsb = n & 1; lsb = n & 1;
if (lsb != 0) if (lsb != 0)
@@ -183,7 +183,7 @@ bitcount_calculate(uint16_t n) {
static void static void
tables_init(void) { tables_init(void) {
uint32_t i; isc_uint32_t i;
for (i = 0; i < 65536; i++) { for (i = 0; i < 65536; i++) {
scounts_table[i] = scount_calculate(i); scounts_table[i] = scount_calculate(i);
@@ -198,12 +198,12 @@ tables_init(void) {
* *
* This function destroys (modifies) the data passed in bits. * This function destroys (modifies) the data passed in bits.
*/ */
static uint32_t static isc_uint32_t
matrix_binaryrank(uint32_t *bits, ssize_t rows, ssize_t cols) { matrix_binaryrank(isc_uint32_t *bits, ssize_t rows, ssize_t cols) {
ssize_t i, j, k; ssize_t i, j, k;
int rt = 0; int rt = 0;
uint32_t rank = 0; isc_uint32_t rank = 0;
uint32_t tmp; isc_uint32_t tmp;
for (k = 0; k < rows; k++) { for (k = 0; k < rows; k++) {
i = k; i = k;
@@ -249,10 +249,10 @@ random_test(pvalue_func_t *func) {
isc_mem_t *mctx = NULL; isc_mem_t *mctx = NULL;
isc_result_t result; isc_result_t result;
isc_rng_t *rng; isc_rng_t *rng;
uint32_t m; isc_uint32_t m;
uint32_t j; isc_uint32_t j;
uint32_t histogram[11]; isc_uint32_t histogram[11];
uint32_t passed; isc_uint32_t passed;
double proportion; double proportion;
double p_hat; double p_hat;
double lower_confidence; double lower_confidence;
@@ -275,8 +275,8 @@ random_test(pvalue_func_t *func) {
histogram[j] = 0; histogram[j] = 0;
for (j = 0; j < m; j++) { for (j = 0; j < m; j++) {
uint32_t i; isc_uint32_t i;
uint16_t values[128000]; isc_uint16_t values[128000];
double p_value; double p_value;
for (i = 0; i < 128000; i++) for (i = 0; i < 128000; i++)
@@ -350,10 +350,10 @@ random_test(pvalue_func_t *func) {
* RNG test suite. * RNG test suite.
*/ */
static double static double
monobit(isc_mem_t *mctx, uint16_t *values, size_t length) { monobit(isc_mem_t *mctx, isc_uint16_t *values, size_t length) {
size_t i; size_t i;
int32_t scount; isc_int32_t scount;
uint32_t numbits; isc_uint32_t numbits;
double s_obs; double s_obs;
double p_value; double p_value;
@@ -381,17 +381,17 @@ monobit(isc_mem_t *mctx, uint16_t *values, size_t length) {
* This is the runs test taken from the NIST SP 800-22 RNG test suite. * This is the runs test taken from the NIST SP 800-22 RNG test suite.
*/ */
static double static double
runs(isc_mem_t *mctx, uint16_t *values, size_t length) { runs(isc_mem_t *mctx, isc_uint16_t *values, size_t length) {
size_t i; size_t i;
uint32_t bcount; isc_uint32_t bcount;
uint32_t numbits; isc_uint32_t numbits;
double pi; double pi;
double tau; double tau;
uint32_t j; isc_uint32_t j;
uint32_t b; isc_uint32_t b;
uint8_t bit_this; isc_uint8_t bit_this;
uint8_t bit_prev; isc_uint8_t bit_prev;
uint32_t v_obs; isc_uint32_t v_obs;
double numer; double numer;
double denom; double denom;
double p_value; double p_value;
@@ -457,14 +457,14 @@ runs(isc_mem_t *mctx, uint16_t *values, size_t length) {
* test suite. * test suite.
*/ */
static double static double
blockfrequency(isc_mem_t *mctx, uint16_t *values, size_t length) { blockfrequency(isc_mem_t *mctx, isc_uint16_t *values, size_t length) {
uint32_t i; isc_uint32_t i;
uint32_t numbits; isc_uint32_t numbits;
uint32_t mbits; isc_uint32_t mbits;
uint32_t mwords; isc_uint32_t mwords;
uint32_t numblocks; isc_uint32_t numblocks;
double *pi; double *pi;
uint32_t cur_word; isc_uint32_t cur_word;
double chi_square; double chi_square;
double p_value; double p_value;
@@ -487,10 +487,10 @@ blockfrequency(isc_mem_t *mctx, uint16_t *values, size_t length) {
cur_word = 0; cur_word = 0;
for (i = 0; i < numblocks; i++) { for (i = 0; i < numblocks; i++) {
uint32_t j; isc_uint32_t j;
pi[i] = 0.0; pi[i] = 0.0;
for (j = 0; j < mwords; j++) { for (j = 0; j < mwords; j++) {
uint32_t idx; isc_uint32_t idx;
idx = i * mwords + j; idx = i * mwords + j;
pi[i] += bitcounts_table[values[idx]]; pi[i] += bitcounts_table[values[idx]];
@@ -521,15 +521,15 @@ blockfrequency(isc_mem_t *mctx, uint16_t *values, size_t length) {
* test suite. * test suite.
*/ */
static double static double
binarymatrixrank(isc_mem_t *mctx, uint16_t *values, size_t length) { binarymatrixrank(isc_mem_t *mctx, isc_uint16_t *values, size_t length) {
uint32_t i; isc_uint32_t i;
size_t matrix_m; size_t matrix_m;
size_t matrix_q; size_t matrix_q;
uint32_t num_matrices; isc_uint32_t num_matrices;
size_t numbits; size_t numbits;
uint32_t fm_0; isc_uint32_t fm_0;
uint32_t fm_1; isc_uint32_t fm_1;
uint32_t fm_rest; isc_uint32_t fm_rest;
double term1; double term1;
double term2; double term2;
double term3; double term3;
@@ -553,17 +553,17 @@ binarymatrixrank(isc_mem_t *mctx, uint16_t *values, size_t length) {
fm_rest = 0; fm_rest = 0;
for (i = 0; i < num_matrices; i++) { for (i = 0; i < num_matrices; i++) {
/* /*
* Each uint32_t supplies 32 bits, so a 32x32 bit matrix * Each isc_uint32_t supplies 32 bits, so a 32x32 bit matrix
* takes up uint32_t array of size 32. * takes up isc_uint32_t array of size 32.
*/ */
uint32_t bits[32]; isc_uint32_t bits[32];
int j; int j;
uint32_t rank; isc_uint32_t rank;
for (j = 0; j < 32; j++) { for (j = 0; j < 32; j++) {
size_t idx; size_t idx;
uint32_t r1; isc_uint32_t r1;
uint32_t r2; isc_uint32_t r2;
idx = i * ((matrix_m * matrix_q) / 16); idx = i * ((matrix_m * matrix_q) / 16);
idx += j * 2; idx += j * 2;

View File

@@ -37,6 +37,7 @@
*\li struct sockaddr *\li struct sockaddr
*\li struct sockaddr_in *\li struct sockaddr_in
*\li struct sockaddr_in6 *\li struct sockaddr_in6
*\li struct sockaddr_storage
*\li in_port_t *\li in_port_t
* *
* It ensures that the AF_ and PF_ macros are defined. * It ensures that the AF_ and PF_ macros are defined.
@@ -187,6 +188,33 @@ struct in6_pktinfo {
}; };
#endif #endif
#ifndef ISC_PLATFORM_HAVESOCKADDRSTORAGE
#define _SS_MAXSIZE 128
#define _SS_ALIGNSIZE (sizeof (isc_uint64_t))
#ifdef ISC_PLATFORM_HAVESALEN
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - (2 * sizeof(isc_uint8_t)))
#define _SS_PAD2SIZE (_SS_MAXSIZE - (_SS_ALIGNSIZE + _SS_PAD1SIZE \
+ 2 * sizeof(isc_uint8_t)))
#else
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(isc_uint16_t))
#define _SS_PAD2SIZE (_SS_MAXSIZE - (_SS_ALIGNSIZE + _SS_PAD1SIZE \
+ sizeof(isc_uint16_t)))
#endif
struct sockaddr_storage {
#ifdef ISC_PLATFORM_HAVESALEN
isc_uint8_t ss_len;
isc_uint8_t ss_family;
#else
isc_uint16_t ss_family;
#endif
char __ss_pad1[_SS_PAD1SIZE];
isc_uint64_t __ss_align; /* field to force desired structure */
char __ss_pad2[_SS_PAD2SIZE];
};
#endif
#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRANY) #if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRANY)
extern const struct in6_addr isc_net_in6addrany; extern const struct in6_addr isc_net_in6addrany;
/*% /*%

View File

@@ -326,6 +326,7 @@ initialize_ipv6only(void) {
#endif /* WANT_IPV6 */ #endif /* WANT_IPV6 */
#ifdef ISC_PLATFORM_HAVEIN6PKTINFO #ifdef ISC_PLATFORM_HAVEIN6PKTINFO
#ifdef WANT_IPV6
static void static void
try_ipv6pktinfo(void) { try_ipv6pktinfo(void) {
int s, on; int s, on;
@@ -377,6 +378,7 @@ initialize_ipv6pktinfo(void) {
RUNTIME_CHECK(isc_once_do(&once_ipv6pktinfo, RUNTIME_CHECK(isc_once_do(&once_ipv6pktinfo,
try_ipv6pktinfo) == ISC_R_SUCCESS); try_ipv6pktinfo) == ISC_R_SUCCESS);
} }
#endif /* WANT_IPV6 */
#endif /* ISC_PLATFORM_HAVEIN6PKTINFO */ #endif /* ISC_PLATFORM_HAVEIN6PKTINFO */
#endif /* ISC_PLATFORM_HAVEIPV6 */ #endif /* ISC_PLATFORM_HAVEIPV6 */
@@ -620,7 +622,11 @@ try_dscp_v4(void) {
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_DGRAM; hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP; hints.ai_protocol = IPPROTO_UDP;
#ifdef AI_NUMERICHOST
hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
#else
hints.ai_flags = AI_PASSIVE;
#endif
n = getaddrinfo("127.0.0.1", NULL, &hints, &res0); n = getaddrinfo("127.0.0.1", NULL, &hints, &res0);
if (n != 0 || res0 == NULL) { if (n != 0 || res0 == NULL) {
@@ -689,7 +695,11 @@ try_dscp_v6(void) {
hints.ai_family = AF_INET6; hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_DGRAM; hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP; hints.ai_protocol = IPPROTO_UDP;
#ifdef AI_NUMERICHOST
hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
#else
hints.ai_flags = AI_PASSIVE;
#endif
n = getaddrinfo("::1", NULL, &hints, &res0); n = getaddrinfo("::1", NULL, &hints, &res0);
if (n != 0 || res0 == NULL) { if (n != 0 || res0 == NULL) {

View File

@@ -1388,7 +1388,7 @@ process_cmsg(isc__socket_t *sock, struct msghdr *msg, isc_socketevent_t *dev) {
|| cmsgp->cmsg_type == IP_RECVTOS || cmsgp->cmsg_type == IP_RECVTOS
#endif #endif
)) { )) {
dev->dscp = (int) *(uint8_t *)CMSG_DATA(cmsgp); dev->dscp = (int) *(unsigned char *)CMSG_DATA(cmsgp);
dev->dscp >>= 2; dev->dscp >>= 2;
dev->attributes |= ISC_SOCKEVENTATTR_DSCP; dev->attributes |= ISC_SOCKEVENTATTR_DSCP;
goto next; goto next;

View File

@@ -54,7 +54,11 @@ isc_result_t
isc_stdio_seek(FILE *f, off_t offset, int whence) { isc_stdio_seek(FILE *f, off_t offset, int whence) {
int r; int r;
#ifdef HAVE_FSEEKO
r = fseeko(f, offset, whence); r = fseeko(f, offset, whence);
#else
r = fseek(f, offset, whence);
#endif
if (r == 0) if (r == 0)
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
else else
@@ -67,7 +71,11 @@ isc_stdio_tell(FILE *f, off_t *offsetp) {
REQUIRE(offsetp != NULL); REQUIRE(offsetp != NULL);
#ifdef HAVE_FTELLO
r = ftello(f); r = ftello(f);
#else
r = ftell(f);
#endif
if (r >= 0) { if (r >= 0) {
*offsetp = r; *offsetp = r;
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);

View File

@@ -39,6 +39,7 @@
#undef MSG_TRUNC #undef MSG_TRUNC
#define ISC_PLATFORM_NEEDNTOP #define ISC_PLATFORM_NEEDNTOP
#define ISC_PLATFORM_NEEDPTON #define ISC_PLATFORM_NEEDPTON
#define ISC_PLATFORM_HAVESOCKADDRSTORAGE
#define ISC_PLATFORM_QUADFORMAT "I64" #define ISC_PLATFORM_QUADFORMAT "I64"

View File

@@ -218,7 +218,9 @@ main(int argc, char *argv[]) {
hints.ai_family = AF_UNSPEC; hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM; hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP; hints.ai_protocol = IPPROTO_UDP;
#ifdef AI_NUMERICHOST
hints.ai_flags = AI_NUMERICHOST; hints.ai_flags = AI_NUMERICHOST;
#endif
gai_error = getaddrinfo(argv[0], "53", &hints, &res); gai_error = getaddrinfo(argv[0], "53", &hints, &res);
if (gai_error != 0) { if (gai_error != 0) {
fprintf(stderr, "getaddrinfo failed: %s\n", fprintf(stderr, "getaddrinfo failed: %s\n",

View File

@@ -185,7 +185,9 @@ main(int argc, char *argv[]) {
hints.ai_family = AF_UNSPEC; hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM; hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP; hints.ai_protocol = IPPROTO_UDP;
#ifdef AI_NUMERICHOST
hints.ai_flags = AI_NUMERICHOST; hints.ai_flags = AI_NUMERICHOST;
#endif
gai_error = getaddrinfo(auth_server, "53", &hints, &res); gai_error = getaddrinfo(auth_server, "53", &hints, &res);
if (gai_error != 0) { if (gai_error != 0) {
fprintf(stderr, "getaddrinfo failed: %s\n", fprintf(stderr, "getaddrinfo failed: %s\n",
@@ -207,7 +209,9 @@ main(int argc, char *argv[]) {
hints.ai_family = AF_UNSPEC; hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM; hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP; hints.ai_protocol = IPPROTO_UDP;
#ifdef AI_NUMERICHOST
hints.ai_flags = AI_NUMERICHOST; hints.ai_flags = AI_NUMERICHOST;
#endif
gai_error = getaddrinfo(recursive_server, "53", &hints, &res); gai_error = getaddrinfo(recursive_server, "53", &hints, &res);
if (gai_error != 0) { if (gai_error != 0) {
fprintf(stderr, "getaddrinfo failed: %s\n", fprintf(stderr, "getaddrinfo failed: %s\n",