]> git.sur5r.net Git - openldap/blobdiff - servers/ldapd/result.c
Replace NULLBER with NULL
[openldap] / servers / ldapd / result.c
index beaef17cd4e9c5685af93f33d64e6e3c9e89aadf..a046a4e62008c029e8cdd3fd1669433af03ca564 100644 (file)
 #include "ldap.h"
 #include "common.h"
 
-extern int     dosyslog;
-#ifdef LDAP_COMPAT
-extern int     ldap_compat;
-#endif
-
 /*
  * dsa_response - called by do_queries() when there is activity on one of
  * the DSA associations.  It is passed the association descriptor on which
@@ -285,12 +280,12 @@ send_ldap_msgresult(
 {
 #ifdef LDAP_CONNECTIONLESS
        if ( m->m_cldap ) {
-               SAFEMEMCPY( (char *)sb->sb_useaddr, &m->m_clientaddr,
-                   sizeof( struct sockaddr ));
+               ber_pvt_sb_udp_set_dst( &sb, &m->m_clientaddr );
+
                Debug( LDAP_DEBUG_TRACE, "UDP response to %s port %d\n", 
                    inet_ntoa(((struct sockaddr_in *)
-                   sb->sb_useaddr)->sin_addr ),
-                   ((struct sockaddr_in *)sb->sb_useaddr)->sin_port, 0 );
+                   &m->m_clientaddr)->sin_addr ),
+                   ((struct sockaddr_in *)&m->m_clientaddr)->sin_port, 0 );
        }
 #endif
        return( send_ldap_result( sb, tag, m->m_msgid, err, matched, text ) );
@@ -310,11 +305,7 @@ send_ldap_result(
        int             rc;
 #ifdef LDAP_CONNECTIONLESS
        int             cldap;
-#endif
-       extern int      version;
-
-#ifdef LDAP_CONNECTIONLESS
-       cldap = ( sb->sb_naddr > 0 );
+       cldap = ( sb->sb_io == &ber_pvt_sb_io_udp );
 #endif
 
        Debug( LDAP_DEBUG_TRACE, "send_ldap_result\n", 0, 0, 0 );
@@ -326,7 +317,7 @@ send_ldap_result(
                tag = LBER_SEQUENCE;
 #endif
 
-       if ( (ber = der_alloc()) == NULLBER ) {
+       if ( (ber = der_alloc()) == NULL ) {
                Debug( LDAP_DEBUG_ANY, "der_alloc failed\n", 0, 0, 0 );
                return( -1 );
        }