Commit 469a45a6 authored by Howard Chu's avatar Howard Chu
Browse files

ITS#4992 fix cldap

parent 8cafa0b1
......@@ -224,8 +224,9 @@ start_again:;
i = ++(ld)->ld_msgid;
#ifdef LDAP_CONNECTIONLESS
if ( LDAP_IS_UDP(ld) ) {
err = ber_write( ber, ld->ld_options.ldo_peer,
sizeof(struct sockaddr), 0);
struct sockaddr sa = {0};
/* dummy, filled with ldo_peer in request.c */
err = ber_write( ber, &sa, sizeof(sa), 0 );
}
if ( LDAP_IS_UDP(ld) && ld->ld_options.ldo_version ==
LDAP_VERSION2 )
......
......@@ -255,6 +255,19 @@ ldap_send_server_request(
use_connection( ld, lc );
#ifdef LDAP_CONNECTIONLESS
if ( LDAP_IS_UDP( ld )) {
BerElement tmpber = *ber;
ber_rewind( &tmpber );
rc = ber_write( &tmpber, ld->ld_options.ldo_peer,
sizeof( struct sockaddr ), 0 );
if ( rc == -1 ) {
ld->ld_errno = LDAP_ENCODING_ERROR;
return rc;
}
}
#endif
/* If we still have an incomplete write, try to finish it before
* dealing with the new request. If we don't finish here, return
* LDAP_BUSY and let the caller retry later. We only allow a single
......
......@@ -259,8 +259,9 @@ ldap_build_search_req(
LDAP_NEXT_MSGID( ld, *idp );
#ifdef LDAP_CONNECTIONLESS
if ( LDAP_IS_UDP(ld) ) {
err = ber_write( ber, ld->ld_options.ldo_peer,
sizeof(struct sockaddr), 0);
struct sockaddr sa = {0};
/* dummy, filled with ldo_peer in request.c */
err = ber_write( ber, &sa, sizeof( sa ), 0 );
}
if ( LDAP_IS_UDP(ld) && ld->ld_options.ldo_version == LDAP_VERSION2) {
char *dn = ld->ld_options.ldo_cldapdn;
......
Supports Markdown
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