}
}
+/** Callback to tidy up when a bind auth trunk request fails
+ *
+ */
+static void ldap_trunk_bind_auth_fail(request_t *request, void *preq, UNUSED void *rctx,
+ UNUSED fr_trunk_request_state_t state, UNUSED void *uctx)
+{
+ fr_ldap_bind_auth_ctx_t *bind = talloc_get_type_abort(preq, fr_ldap_bind_auth_ctx_t);
+
+ /*
+ * Failed trunk requests get freed - so remove association in bind structure,
+ * and change talloc parentage so resume function still has something to work with.
+ */
+ bind->treq = NULL;
+ bind->ret = LDAP_PROC_ERROR;
+ talloc_steal(NULL, bind);
+
+ /*
+ * Ensure request is runnable.
+ */
+ if (request) unlang_interpret_mark_runnable(request);
+}
+
/** Find the thread specific trunk to use for LDAP bind auths
*
* If there is no current trunk then a new one is created.
.request_mux = ldap_trunk_bind_auth_mux,
.request_demux = ldap_trunk_bind_auth_demux,
.request_cancel_mux = ldap_bind_auth_cancel_mux,
+ .request_fail = ldap_trunk_bind_auth_fail,
},
thread->bind_trunk_conf,
"rlm_ldap bind auth", ttrunk, false);