diff options
Diffstat (limited to 'lib/isc/unix')
-rw-r--r-- | lib/isc/unix/ifiter_ioctl.c | 9 | ||||
-rw-r--r-- | lib/isc/unix/net.c | 25 | ||||
-rw-r--r-- | lib/isc/unix/socket.c | 12 | ||||
-rw-r--r-- | lib/isc/unix/syslog.c | 4 |
4 files changed, 32 insertions, 18 deletions
diff --git a/lib/isc/unix/ifiter_ioctl.c b/lib/isc/unix/ifiter_ioctl.c index 596a7b5d..46949e8f 100644 --- a/lib/isc/unix/ifiter_ioctl.c +++ b/lib/isc/unix/ifiter_ioctl.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ifiter_ioctl.c,v 1.57 2007/06/19 23:47:18 tbox Exp $ */ +/* $Id: ifiter_ioctl.c,v 1.58 2007/08/30 06:02:28 marka Exp $ */ /*! \file * \brief @@ -905,7 +905,8 @@ internal_next4(isc_interfaceiter_t *iter) { struct ifreq *ifrp; #endif - REQUIRE (iter->pos < (unsigned int) iter->ifc.ifc_len); + REQUIRE(iter->ifc.ifc_len == 0 || + iter->pos < (unsigned int) iter->ifc.ifc_len); #ifdef __linux if (linux_if_inet6_next(iter) == ISC_R_SUCCESS) @@ -913,6 +914,10 @@ internal_next4(isc_interfaceiter_t *iter) { if (!iter->first) return (ISC_R_SUCCESS); #endif + + if (iter->ifc.ifc_len == 0) + return (ISC_R_NOMORE); + #ifdef ISC_PLATFORM_HAVESALEN ifrp = (struct ifreq *)((char *) iter->ifc.ifc_req + iter->pos); diff --git a/lib/isc/unix/net.c b/lib/isc/unix/net.c index 7849b7f4..b19ace9c 100644 --- a/lib/isc/unix/net.c +++ b/lib/isc/unix/net.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: net.c,v 1.35 2007/06/19 23:47:18 tbox Exp $ */ +/* $Id: net.c,v 1.36 2007/09/13 04:45:18 each Exp $ */ #include <config.h> @@ -30,17 +30,26 @@ #include <isc/string.h> #include <isc/util.h> -#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRANY) +#if defined(ISC_PLATFORM_HAVEIPV6) +# if defined(ISC_PLATFORM_NEEDIN6ADDRANY) const struct in6_addr isc_net_in6addrany = IN6ADDR_ANY_INIT; -#endif +# endif -#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK) +# if defined(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK) const struct in6_addr isc_net_in6addrloop = IN6ADDR_LOOPBACK_INIT; -#endif +# endif -static isc_once_t once = ISC_ONCE_INIT; +# if defined(WANT_IPV6) static isc_once_t once_ipv6only = ISC_ONCE_INIT; +# endif + +# if defined(ISC_PLATFORM_HAVEIN6PKTINFO) static isc_once_t once_ipv6pktinfo = ISC_ONCE_INIT; +# endif +#endif /* ISC_PLATFORM_HAVEIPV6 */ + +static isc_once_t once = ISC_ONCE_INIT; + static isc_result_t ipv4_result = ISC_R_NOTFOUND; static isc_result_t ipv6_result = ISC_R_NOTFOUND; static isc_result_t unix_result = ISC_R_NOTFOUND; @@ -245,7 +254,7 @@ initialize_ipv6only(void) { RUNTIME_CHECK(isc_once_do(&once_ipv6only, try_ipv6only) == ISC_R_SUCCESS); } -#endif /* IPV6_V6ONLY */ +#endif /* WANT_IPV6 */ #ifdef ISC_PLATFORM_HAVEIN6PKTINFO static void @@ -301,7 +310,7 @@ initialize_ipv6pktinfo(void) { try_ipv6pktinfo) == ISC_R_SUCCESS); } #endif /* ISC_PLATFORM_HAVEIN6PKTINFO */ -#endif /* WANT_IPV6 */ +#endif /* ISC_PLATFORM_HAVEIPV6 */ isc_result_t isc_net_probe_ipv6only(void) { diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index ff33076f..59d72d09 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.c,v 1.273 2007/06/18 23:47:48 tbox Exp $ */ +/* $Id: socket.c,v 1.274 2007/07/27 14:28:04 explorer Exp $ */ /*! \file */ @@ -4060,15 +4060,15 @@ isc_socket_gettag(isc_socket_t *socket) { #ifdef HAVE_LIBXML2 static const char * -_socktype(int type) +_socktype(isc_sockettype_t type) { - if (type == 1) + if (type == isc_sockettype_udp) return ("udp"); - else if (type == 2) + else if (type == isc_sockettype_tcp) return ("tcp"); - else if (type == 3) + else if (type == isc_sockettype_unix) return ("unix"); - else if (type == 4) + else if (type == isc_sockettype_fdwatch) return ("fdwatch"); else return ("not-initialized"); diff --git a/lib/isc/unix/syslog.c b/lib/isc/unix/syslog.c index 974cb812..997508e3 100644 --- a/lib/isc/unix/syslog.c +++ b/lib/isc/unix/syslog.c @@ -15,17 +15,17 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: syslog.c,v 1.7 2007/06/19 23:47:18 tbox Exp $ */ +/* $Id: syslog.c,v 1.8 2007/09/13 04:45:18 each Exp $ */ /*! \file */ #include <config.h> #include <stdlib.h> -#include <string.h> #include <syslog.h> #include <isc/result.h> +#include <isc/string.h> #include <isc/syslog.h> #include <isc/util.h> |