]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
fixes from Vadim
authorAlan T. DeKok <aland@freeradius.org>
Mon, 5 Apr 2021 13:09:50 +0000 (09:09 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 22 Jul 2021 13:55:24 +0000 (09:55 -0400)
request->proxy_listener is NULL after removing it from the proxy
hash, so cache the reverse_coa status.

src/main/process.c

index 31185a94c605c708f233623f5c26da1a56690c3b..7f16a101ff71be805618d44131b0ee246ccea7fd 100644 (file)
@@ -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);