Skip to content

Commit aef528b

Browse files
committed
pass type instance to post-proxy callback
1 parent 83d78ed commit aef528b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/modules/rlm_eap/eap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ typedef int (*eap_tunnel_callback_t)(eap_handler_t *handler, void *tls_session);
150150
typedef struct eap_tunnel_data_t {
151151
void *tls_session;
152152
eap_tunnel_callback_t callback;
153+
void *type_inst;
153154
} eap_tunnel_data_t;
154155

155156
#endif /*_EAP_H*/

src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,12 @@ static int mod_session_init(void *instance, eap_handler_t *handler)
304304
*
305305
* Called from rlm_eap.c, eap_postproxy().
306306
*/
307-
static int CC_HINT(nonnull) mschap_postproxy(eap_handler_t *handler, UNUSED void *tunnel_data)
307+
static int CC_HINT(nonnull) mschap_postproxy(eap_handler_t *handler, void *uctx)
308308
{
309309
VALUE_PAIR *response = NULL;
310310
mschapv2_opaque_t *data;
311311
REQUEST *request = handler->request;
312+
eap_tunnel_data_t *tunnel_data = uctx;
312313

313314
data = (mschapv2_opaque_t *) handler->opaque;
314315
rad_assert(request != NULL);
@@ -347,7 +348,7 @@ static int CC_HINT(nonnull) mschap_postproxy(eap_handler_t *handler, UNUSED void
347348
* Done doing EAP proxy stuff.
348349
*/
349350
request->options &= ~RAD_REQUEST_OPTION_PROXY_EAP;
350-
eapmschapv2_compose(NULL, handler, response);
351+
eapmschapv2_compose(tunnel_data->type_inst, handler, response);
351352
data->code = PW_EAP_MSCHAPV2_SUCCESS;
352353

353354
/*
@@ -641,6 +642,7 @@ static int CC_HINT(nonnull) mod_process(void *arg, eap_handler_t *handler)
641642

642643
tunnel->tls_session = arg;
643644
tunnel->callback = mschap_postproxy;
645+
tunnel->type_inst = inst;
644646

645647
/*
646648
* Associate the callback with the request.

0 commit comments

Comments
 (0)