Commit 2b66a51a authored by Mark Andrews's avatar Mark Andrews

1950. [port] Solaris 2.5.1 and earlier cannot bind() then connect()

                        a TCP socket. This prevents the source address being
                        set for TCP connections. [RT #15628]
parent e9733bc5
1950. [port] Solaris 2.5.1 and earlier cannot bind() then connect()
a TCP socket. This prevents the source address being
set for TCP connections. [RT #15628]
1949. [func] Addition memory leakage checks. [RT #15544] 1949. [func] Addition memory leakage checks. [RT #15544]
1948. [bug] If was possible to trigger a REQUIRE failure in 1948. [bug] If was possible to trigger a REQUIRE failure in
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: config.h.in,v 1.75 2005/10/20 23:50:53 marka Exp $ */ /* $Id: config.h.in,v 1.77 2006/01/05 00:30:34 marka Exp $ */
/*! \file */ /*! \file */
...@@ -150,6 +150,9 @@ int sigwait(const unsigned int *set, int *sig); ...@@ -150,6 +150,9 @@ int sigwait(const unsigned int *set, int *sig);
/* Define if threads need PTHREAD_SCOPE_SYSTEM */ /* Define if threads need PTHREAD_SCOPE_SYSTEM */
#undef NEED_PTHREAD_SCOPE_SYSTEM #undef NEED_PTHREAD_SCOPE_SYSTEM
/* Define if you cannot bind() before connect() for TCP sockets. */
#undef BROKEN_TCP_BIND_BEFORE_CONNECT
/* Define to 1 if you have the <dlfcn.h> header file. */ /* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H #undef HAVE_DLFCN_H
......
#! /bin/sh #! /bin/sh
# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1996-2003 Internet Software Consortium. # Copyright (C) 1996-2003 Internet Software Consortium.
# #
# Permission to use, copy, modify, and distribute this software for any # Permission to use, copy, modify, and distribute this software for any
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE. # PERFORMANCE OF THIS SOFTWARE.
# #
# $Id: configure,v 1.385 2005/10/20 23:50:53 marka Exp $ # $Id: configure,v 1.386 2006/01/04 04:15:55 marka Exp $
# #
# Portions Copyright (C) 1996-2001 Nominum, Inc. # Portions Copyright (C) 1996-2001 Nominum, Inc.
# #
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# From configure.in Revision: 1.396 . # From configure.in Revision: 1.397 .
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59. # Generated by GNU Autoconf 2.59.
# #
...@@ -27822,6 +27822,19 @@ _ACEOF ...@@ -27822,6 +27822,19 @@ _ACEOF
;; ;;
esac esac
# #
# Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
# This prevents the source address being set.
#
case "$host" in
*-solaris2.[012345]|*-solaris2.5.1)
cat >>confdefs.h <<\_ACEOF
#define BROKEN_TCP_BIND_BEFORE_CONNECT 1
_ACEOF
;;
esac
#
# The following sections deal with tools used for formatting # The following sections deal with tools used for formatting
# the documentation. They are all optional, unless you are # the documentation. They are all optional, unless you are
# a developer editing the documentation source. # a developer editing the documentation source.
......
...@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl ...@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl
esyscmd([sed "s/^/# /" COPYRIGHT])dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl AC_DIVERT_POP()dnl
AC_REVISION($Revision: 1.396 $) AC_REVISION($Revision: 1.397 $)
AC_INIT(lib/dns/name.c) AC_INIT(lib/dns/name.c)
AC_PREREQ(2.59) AC_PREREQ(2.59)
...@@ -2020,6 +2020,16 @@ case "$host" in ...@@ -2020,6 +2020,16 @@ case "$host" in
;; ;;
esac esac
# #
# Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
# This prevents the source address being set.
#
case "$host" in
*-solaris2.[[012345]]|*-solaris2.5.1)
AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
[Define if you cannot bind() before connect() for TCP sockets.])
;;
esac
#
# The following sections deal with tools used for formatting # The following sections deal with tools used for formatting
# the documentation. They are all optional, unless you are # the documentation. They are all optional, unless you are
# a developer editing the documentation source. # a developer editing the documentation source.
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE. - PERFORMANCE OF THIS SOFTWARE.
--> -->
<!-- File: $Id: Bv9ARM-book.xml,v 1.284 2006/01/04 02:35:49 marka Exp $ --> <!-- File: $Id: Bv9ARM-book.xml,v 1.285 2006/01/04 04:14:39 marka Exp $ -->
<book xmlns:xi="http://www.w3.org/2001/XInclude"> <book xmlns:xi="http://www.w3.org/2001/XInclude">
<title>BIND 9 Administrator Reference Manual</title> <title>BIND 9 Administrator Reference Manual</title>
...@@ -5977,6 +5977,12 @@ query-source-v6 address * port *; ...@@ -5977,6 +5977,12 @@ query-source-v6 address * port *;
unprivileged port. unprivileged port.
</para> </para>
</note> </note>
<note>
<para>
Solaris 2.5.1 and earlier does not support setting the source
address for TCP sockets.
</para>
</note>
<note> <note>
<para> <para>
See also <command>transfer-source</command> and See also <command>transfer-source</command> and
...@@ -6202,6 +6208,12 @@ query-source-v6 address * port *; ...@@ -6202,6 +6208,12 @@ query-source-v6 address * port *;
<command>zone</command> block in the configuration <command>zone</command> block in the configuration
file. file.
</para> </para>
<note>
<para>
Solaris 2.5.1 and earlier does not support setting the
source address for TCP sockets.
</para>
</note>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -6277,6 +6289,12 @@ query-source-v6 address * port *; ...@@ -6277,6 +6289,12 @@ query-source-v6 address * port *;
<command>view</command> block in the configuration <command>view</command> block in the configuration
file. file.
</para> </para>
<note>
<para>
Solaris 2.5.1 and earlier does not support setting the
source address for TCP sockets.
</para>
</note>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: request.c,v 1.74 2005/04/29 00:22:51 marka Exp $ */ /* $Id: request.c,v 1.75 2006/01/04 04:14:39 marka Exp $ */
/*! \file */ /*! \file */
...@@ -514,6 +514,7 @@ create_tcp_dispatch(dns_requestmgr_t *requestmgr, isc_sockaddr_t *srcaddr, ...@@ -514,6 +514,7 @@ create_tcp_dispatch(dns_requestmgr_t *requestmgr, isc_sockaddr_t *srcaddr,
isc_sockettype_tcp, &socket); isc_sockettype_tcp, &socket);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
return (result); return (result);
#ifndef BROKEN_TCP_BIND_BEFORE_CONNECT
if (srcaddr == NULL) { if (srcaddr == NULL) {
isc_sockaddr_anyofpf(&bind_any, isc_sockaddr_anyofpf(&bind_any,
isc_sockaddr_pf(destaddr)); isc_sockaddr_pf(destaddr));
...@@ -525,6 +526,7 @@ create_tcp_dispatch(dns_requestmgr_t *requestmgr, isc_sockaddr_t *srcaddr, ...@@ -525,6 +526,7 @@ create_tcp_dispatch(dns_requestmgr_t *requestmgr, isc_sockaddr_t *srcaddr,
} }
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
goto cleanup; goto cleanup;
#endif
attrs = 0; attrs = 0;
attrs |= DNS_DISPATCHATTR_TCP; attrs |= DNS_DISPATCHATTR_TCP;
attrs |= DNS_DISPATCHATTR_PRIVATE; attrs |= DNS_DISPATCHATTR_PRIVATE;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: resolver.c,v 1.323 2006/01/04 00:37:24 marka Exp $ */ /* $Id: resolver.c,v 1.324 2006/01/04 04:14:39 marka Exp $ */
/*! \file */ /*! \file */
...@@ -1070,9 +1070,11 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, ...@@ -1070,9 +1070,11 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
goto cleanup_query; goto cleanup_query;
#ifndef BROKEN_TCP_BIND_BEFORE_CONNECT
result = isc_socket_bind(query->tcpsocket, &addr); result = isc_socket_bind(query->tcpsocket, &addr);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
goto cleanup_socket; goto cleanup_socket;
#endif
/* /*
* A dispatch will be created once the connect succeeds. * A dispatch will be created once the connect succeeds.
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: xfrin.c,v 1.143 2006/01/04 03:03:11 marka Exp $ */ /* $Id: xfrin.c,v 1.144 2006/01/04 04:14:39 marka Exp $ */
/*! \file */ /*! \file */
...@@ -821,7 +821,9 @@ xfrin_start(dns_xfrin_ctx_t *xfr) { ...@@ -821,7 +821,9 @@ xfrin_start(dns_xfrin_ctx_t *xfr) {
isc_sockaddr_pf(&xfr->sourceaddr), isc_sockaddr_pf(&xfr->sourceaddr),
isc_sockettype_tcp, isc_sockettype_tcp,
&xfr->socket)); &xfr->socket));
#ifndef BROKEN_TCP_BIND_BEFORE_CONNECT
CHECK(isc_socket_bind(xfr->socket, &xfr->sourceaddr)); CHECK(isc_socket_bind(xfr->socket, &xfr->sourceaddr));
#endif
CHECK(isc_socket_connect(xfr->socket, &xfr->masteraddr, xfr->task, CHECK(isc_socket_connect(xfr->socket, &xfr->masteraddr, xfr->task,
xfrin_connect_done, xfr)); xfrin_connect_done, xfr));
xfr->connects++; xfr->connects++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment