]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
fail connection if we can't set it async. CID #1419873
authorAlan T. DeKok <aland@freeradius.org>
Fri, 20 Oct 2017 18:05:22 +0000 (14:05 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 20 Oct 2017 18:05:22 +0000 (14:05 -0400)
src/lib/ldap/connection.c

index f7104ceb55914e0c7e6d81e552b610ef3c22cff4..82356cb9199e4610c7d3807ebd1b12615b25e26b 100644 (file)
@@ -418,7 +418,10 @@ static fr_connection_state_t _ldap_connection_init(int *fd_out, void *uctx)
         */
        if (fr_ldap_connection_configure(c, c->config) < 0) return FR_CONNECTION_STATE_FAILED;
 
-       ldap_set_option(c->handle, LDAP_OPT_CONNECT_ASYNC, LDAP_OPT_ON);        /* Don't block */
+       /* Don't block */
+       if (ldap_set_option(c->handle, LDAP_OPT_CONNECT_ASYNC, LDAP_OPT_ON) != LDAP_OPT_SUCCESS) {
+               return FR_CONNECTION_STATE_FAILED;
+       }
        fr_ldap_connection_timeout_set(c, &to);                                 /* Forces LDAP_X_CONNECTING */
 
        state = fr_ldap_state_next(c);