From: Alan T. DeKok Date: Tue, 6 Apr 2021 12:31:25 +0000 (-0400) Subject: hoist reverse_coa checks before _all_ "remove from proxy hash" calls X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2502068f261ed3bf1c208ad3e62b1dfa6909d68;p=thirdparty%2Ffreeradius-server.git hoist reverse_coa checks before _all_ "remove from proxy hash" calls --- diff --git a/src/main/process.c b/src/main/process.c index fb74da8cf2..df705e830d 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -2523,6 +2523,15 @@ static int process_proxy_reply(REQUEST *request, RADIUS_PACKET *reply) if (post_proxy_type > 0) RDEBUG2("Found Post-Proxy-Type %s", dict_valnamebyattr(PW_POST_PROXY_TYPE, 0, post_proxy_type)); +#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 + if (reply) { VERIFY_PACKET(reply); @@ -2547,14 +2556,6 @@ 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); }