From: Alan T. DeKok Date: Mon, 5 Apr 2021 13:09:50 +0000 (-0400) Subject: fixes from Vadim X-Git-Tag: release_3_0_24~134 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8d0a58e2b21326b35938c3dcbc40b25426a5967;p=thirdparty%2Ffreeradius-server.git fixes from Vadim request->proxy_listener is NULL after removing it from the proxy hash, so cache the reverse_coa status. --- diff --git a/src/main/process.c b/src/main/process.c index 31185a94c60..7f16a101ff7 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -2444,6 +2444,9 @@ static int process_proxy_reply(REQUEST *request, RADIUS_PACKET *reply) int post_proxy_type = 0; VALUE_PAIR *vp; char const *old_server; +#ifdef WITH_COA_TUNNEL + bool reverse_coa = false; +#endif VERIFY_REQUEST(request); @@ -2531,6 +2534,14 @@ static int process_proxy_reply(REQUEST *request, RADIUS_PACKET *reply) rad_assert(!request->in_proxy_hash); } } else if (request->in_proxy_hash) { +#ifdef WITH_COA_TUNNEL + /* + * Cache this, as request->proxy_listener will be + * NULL after removing the request from the proxy + * hash. + */ + reverse_coa = request->proxy_listener->type != RAD_LISTEN_PROXY; +#endif remove_from_proxy_hash(request); } @@ -2545,7 +2556,7 @@ static int process_proxy_reply(REQUEST *request, RADIUS_PACKET *reply) request->server = request->home_server->virtual_server; #ifdef WITH_COA_TUNNEL - } else if (request->proxy_listener && (request->proxy_listener->type != RAD_LISTEN_PROXY)) { + } else if (reverse_coa) { rad_assert((request->proxy->code == PW_CODE_COA_REQUEST) || (request->proxy->code == PW_CODE_DISCONNECT_REQUEST)); rad_assert(request->home_server != NULL);