]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix passing keepalive config items
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 24 Sep 2021 20:18:26 +0000 (15:18 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 24 Sep 2021 20:18:26 +0000 (15:18 -0500)
src/lib/ldap/connection.c
src/lib/ldap/sasl.c

index 4d0e1959db59dcb717d3489f91309dce5ca6d0c4..99ad6d5ea6f0fedffde41da8b7cb69c3f75cb288 100644 (file)
@@ -250,17 +250,27 @@ DIAG_ON(unused-macros)
        do_ldap_option(LDAP_OPT_PROTOCOL_VERSION, "ldap_version", &ldap_version);
 
 #ifdef LDAP_OPT_X_KEEPALIVE_IDLE
-       do_ldap_option(LDAP_OPT_X_KEEPALIVE_IDLE, "keepalive_idle",
-                      &fr_time_delta_to_timeval(config->keepalive_idle));
+       {
+               int keepalive = fr_time_delta_to_sec(config->keepalive_idle);
+
+               do_ldap_option(LDAP_OPT_X_KEEPALIVE_IDLE, "keepalive_idle", &keepalive);
+       }
 #endif
 
 #ifdef LDAP_OPT_X_KEEPALIVE_PROBES
-       do_ldap_option(LDAP_OPT_X_KEEPALIVE_PROBES, "keepalive_probes", config->keepalive_probes);
+       {
+               int probes = config->keepalive_probes;
+
+               do_ldap_option(LDAP_OPT_X_KEEPALIVE_PROBES, "keepalive_probes", &probes);
+       }
 #endif
 
 #ifdef LDAP_OPT_X_KEEPALIVE_INTERVAL
-       do_ldap_option(LDAP_OPT_X_KEEPALIVE_INTERVAL, "keepalive_interval",
-                      fr_time_delta_to_sec(config->keepalive_interval));
+       {
+               int keepalive = fr_time_delta_to_sec(config->keepalive_interval);
+
+               do_ldap_option(LDAP_OPT_X_KEEPALIVE_INTERVAL, "keepalive_interval", &keepalive);
+       }
 #endif
 
 #ifdef HAVE_LDAP_START_TLS_S
index 2085cef7b2f10064424af1bce24e52a27457a23e..be03ee5a5bb981c887c785b7d1c7f74dea083ccc 100644 (file)
@@ -205,7 +205,7 @@ static void _ldap_sasl_bind_io_write(fr_event_list_t *el, int fd, UNUSED int fla
         *      Set timeout to be 0.0, which is the magic
         *      non-blocking value.
         */
-       (void) ldap_set_option(c->handle, LDAP_OPT_NETWORK_TIMEOUT, &fr_time_delta_to_timeval(0));
+       (void) ldap_set_option(c->handle, LDAP_OPT_NETWORK_TIMEOUT, &fr_time_delta_to_timeval(fr_time_delta_wrap(0)));
        ret = ldap_sasl_interactive_bind(c->handle, NULL, sasl_ctx->mechs,
                                         our_serverctrls, our_clientctrls,
                                         LDAP_SASL_AUTOMATIC,