From: Arran Cudbard-Bell Date: Fri, 24 Sep 2021 20:18:26 +0000 (-0500) Subject: Fix passing keepalive config items X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f09345aff038e7aff966a55abb6e4d179f39989;p=thirdparty%2Ffreeradius-server.git Fix passing keepalive config items --- diff --git a/src/lib/ldap/connection.c b/src/lib/ldap/connection.c index 4d0e1959db..99ad6d5ea6 100644 --- a/src/lib/ldap/connection.c +++ b/src/lib/ldap/connection.c @@ -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 diff --git a/src/lib/ldap/sasl.c b/src/lib/ldap/sasl.c index 2085cef7b2..be03ee5a5b 100644 --- a/src/lib/ldap/sasl.c +++ b/src/lib/ldap/sasl.c @@ -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,