From: Alan T. DeKok Date: Mon, 21 Sep 2015 13:34:40 +0000 (-0400) Subject: Set request->module to the request state X-Git-Tag: release_3_0_10~59 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=freeradius.git;a=commitdiff_plain;h=c204acb3a2db2bc7842af9486f5b8800eb127cca Set request->module to the request state --- diff --git a/src/main/process.c b/src/main/process.c index 5200d8a..3d20e38 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -614,6 +614,7 @@ static void request_done(REQUEST *request, int action) */ if (!we_are_master()) { NO_CHILD_THREAD; + request->module = ""; request->child_state = REQUEST_DONE; return; } @@ -852,6 +853,7 @@ static void request_cleanup_delay_init(REQUEST *request) if (!we_are_master()) { NO_CHILD_THREAD; + request->module = ""; request->child_state = REQUEST_CLEANUP_DELAY; return; } @@ -1342,6 +1344,7 @@ static void request_finish(REQUEST *request, int action) if (request->packet->dst_port == 0) { RDEBUG("Finished internally proxied request."); NO_CHILD_THREAD; + request->module = ""; request->child_state = REQUEST_DONE; return; } @@ -1479,6 +1482,7 @@ static void request_finish(REQUEST *request, int action) request->module = ""; request->process = request_response_delay; NO_CHILD_THREAD; + request->module = ""; request->child_state = REQUEST_RESPONSE_DELAY; } } @@ -1523,6 +1527,7 @@ static void request_running(REQUEST *request, int action) #endif NO_CHILD_THREAD; + request->module = ""; request->child_state = REQUEST_DONE; break; } @@ -1822,9 +1827,6 @@ static REQUEST *request_setup(TALLOC_CTX *ctx, rad_listen_t *listener, RADIUS_PA child_state_names[request->child_state], child_state_names[REQUEST_RUNNING]); #endif -#ifdef HAVE_PTHREAD_H - request->child_pid = NO_SUCH_CHILD_PID; -#endif request->handle = fun; NO_CHILD_THREAD; @@ -3237,9 +3239,14 @@ static int request_proxy(REQUEST *request, int retransmit) /* * Set the state function, then the state, no child, and * send the packet. + * + * The order here is different from other state changes + * due to race conditions with replies from the home + * server. */ request->process = proxy_wait_for_reply; request->child_state = REQUEST_PROXIED; + request->module = ""; NO_CHILD_THREAD; /*