Issue 8968 - Async connect mode does not work on Solaris
Summary: Async connect mode does not work on Solaris
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: 2.4.47
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-30 23:19 UTC by vsmith@interlinknetworks.com
Modified: 2023-11-07 16:57 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description vsmith@interlinknetworks.com 2019-01-30 23:19:18 UTC
Full_Name: Vernon Smith
Version: 2.4.47
OS: Solaris 10
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (2601:40d:4300:679a:c0c9:ced:d06f:39a4)


I have managed to upgrade to version 2.4.47 libldap libraries using the Linux OS
and async connect mode works fine. But when I tried to upgrade to 2.4.47 using
Solaris OS and use async connect mode, no connections could be established to
the ldap server. The libldap code did not even send the ldap request to the ldap
server. The ldap debug trace showed it just freeing the request and returned an
unable to connect. I traced the issue to the routine ldap_int_flush_request
which checks the sock_errno return code for EAGAIN but Solaris 10 returns
ENOTCONN. This error code seems to mean the same thing as EAGAIN. I changed the
code to test for either return code and the async connect works for both Linux
and Solaris now. Here is may patch.

diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c
index 9355d7e..321b79f 100644
--- a/libraries/libldap/request.c
+++ b/libraries/libldap/request.c
@@ -184,7 +184,7 @@ ldap_int_flush_request(
 
 	LDAP_ASSERT_MUTEX_OWNER( &ld->ld_conn_mutex );
 	if ( ber_flush2( lc->lconn_sb, lr->lr_ber, LBER_FLUSH_FREE_NEVER ) != 0 ) {
-		if ( sock_errno() == EAGAIN ) {
+		if (( sock_errno() == EAGAIN ) || ( sock_errno() == ENOTCONN )) {
 			/* need to continue write later */
 			lr->lr_status = LDAP_REQST_WRITING;
 			ldap_mark_select_write( ld, lc->lconn_sb );

Thanks,
Vern
Comment 1 Quanah Gibson-Mount 2019-01-31 00:17:14 UTC
changed notes
Comment 2 Quanah Gibson-Mount 2019-01-31 23:36:19 UTC
--On Wednesday, January 30, 2019 11:19 PM +0000 
vsmith@interlinknetworks.com wrote:

> Full_Name: Vernon Smith
> Version: 2.4.47
> OS: Solaris 10
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (2601:40d:4300:679a:c0c9:ced:d06f:39a4)
>
>
> I have managed to upgrade to version 2.4.47 libldap libraries using the
> Linux OS and async connect mode works fine. But when I tried to upgrade
> to 2.4.47 using Solaris OS and use async connect mode, no connections
> could be established to the ldap server. The libldap code did not even
> send the ldap request to the ldap server. The ldap debug trace showed it
> just freeing the request and returned an unable to connect. I traced the
> issue to the routine ldap_int_flush_request which checks the sock_errno
> return code for EAGAIN but Solaris 10 returns ENOTCONN. This error code
> seems to mean the same thing as EAGAIN. I changed the code to test for
> either return code and the async connect works for both Linux and Solaris
> now. Here is may patch.

Thanks for the report, this is now fixed in master (and will be a part of 
the next RE24 release).

Regards,
Quanah


--

Quanah Gibson-Mount
Product Architect
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:
<http://www.symas.com>


Comment 3 Quanah Gibson-Mount 2019-01-31 23:37:52 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 4 Quanah Gibson-Mount 2019-01-31 23:48:55 UTC
changed notes
changed state Test to Release
Comment 5 OpenLDAP project 2019-07-24 19:02:17 UTC
Fixed in master
Fixed in RE24 (2.4.48)
Comment 6 Quanah Gibson-Mount 2019-07-24 19:02:17 UTC
changed notes
changed state Release to Closed