]> git.sur5r.net Git - openldap/commitdiff
Fix -lldap high port bug
authorKurt Zeilenga <kurt@openldap.org>
Mon, 8 Oct 2001 17:58:47 +0000 (17:58 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 8 Oct 2001 17:58:47 +0000 (17:58 +0000)
CHANGES
libraries/libldap/open.c
libraries/libldap/os-ip.c

diff --git a/CHANGES b/CHANGES
index 20c0fe1a02e718018345682e2495545517cddf5f..8563dee646a28afb936f5d920da486ef23046625 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,22 +1,25 @@
 OpenLDAP 2.0 Change Log
 
 OpenLDAP 2.0.16 Engineering
-       Fixed CR/LF handling (ITS#1328)
        Fixed slapd/slurpd maxargs bug (ITS#1343)
        Fixed slapd ManageDSAIT warning
        Fixed slurpd server down reject fix (ITS#1183)
        Fixed -llber ber_realloc bug (ITS#1346)
        Fixed -lldap multi-level referral chase bug (ITS#1346)
+       Fixed -lldap high port bug
+       Fixed CR/LF handling (ITS#1328)
        Updated slapd/-lldap getaddrinfo handling
        Updated -lldap_r pthread stack size
        Updated slapd acl assert checks
        Removed -lldbm use of Berkeley CDB
+       Updated -lldbm to use r/w lock with DB_THREAD
        Added back-ldbm idl_check() code
        Build environment
                Updated ltconfig for MacOS X 10.1 (ITS#1361)
                Updated slapd.conf with ACL example
                Updated pthread detection
-               Adjust test 7 read/write ratio
+               Updated test005 /dev/null diff for Tru64 compat
+               Updated test007 read/write ratio
 
 OpenLDAP 2.0.15 Release
        Fixed -lldap TLS external handling
index 987427684ac95d23263ffb0792f3639b5c18175d..950ccc8142065a42e7826d748a9dad724bdb7475 100644 (file)
@@ -262,7 +262,7 @@ ldap_int_open_connection(
 
        switch ( ldap_pvt_url_scheme2proto( srv->lud_scheme ) ) {
                case LDAP_PROTO_TCP:
-                       port = htons( (short) srv->lud_port );
+                       port = srv->lud_port;
 
                        addr = 0;
                        if ( srv->lud_host == NULL || *srv->lud_host == 0 ) {
index 372d22ddfde05fa36a36cd8b29c70a24ac29a245..31367114dac3761fba6da02995fe60c199441864 100644 (file)
@@ -286,7 +286,7 @@ int
 ldap_connect_to_host(LDAP *ld, Sockbuf *sb,
        int proto,
        const char *host,
-       unsigned long address, int port, int async)
+       unsigned long address, int port, int async )
 {
        struct sockaddr_in      sin;
        ber_socket_t            s = AC_SOCKET_INVALID;
@@ -306,7 +306,7 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb,
                hints.ai_family = AF_UNSPEC;
                hints.ai_socktype = SOCK_STREAM;
 
-               snprintf(serv, sizeof serv, "%d", ntohs(port));
+               snprintf(serv, sizeof serv, "%d", port );
                if ( err = getaddrinfo(host, serv, &hints, &res) ) {
                        osip_debug(ld, "ldap_connect_to_host: getaddrinfo failed: %s\n",
                                AC_GAI_STRERROR(err), 0, 0);
@@ -389,7 +389,6 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb,
 
        rc = s = -1;
        for ( i = 0; !use_hp || (hp->h_addr_list[i] != 0); ++i, rc = -1 ) {
-
                s = ldap_int_socket( ld, PF_INET, SOCK_STREAM );
                if ( s == AC_SOCKET_INVALID ) {
                        /* use_hp ? continue : break; */
@@ -403,13 +402,13 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb,
 
                (void)memset((char *)&sin, '\0', sizeof(struct sockaddr_in));
                sin.sin_family = AF_INET;
-               sin.sin_port = port;
+               sin.sin_port = htons((short) port);
                p = (char *)&sin.sin_addr;
                q = use_hp ? (char *)hp->h_addr_list[i] : (char *)&address;
                AC_MEMCPY(p, q, sizeof(sin.sin_addr) );
 
                osip_debug(ld, "ldap_connect_to_host: Trying %s:%d\n", 
-                               inet_ntoa(sin.sin_addr),ntohs(sin.sin_port),0);
+                       inet_ntoa(sin.sin_addr),port,0);
 
                rc = ldap_pvt_connect(ld, s,
                        (struct sockaddr *)&sin, sizeof(struct sockaddr_in),