]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow multiple Proxy-To-Originating-Realm keys
authorAlan T. DeKok <aland@freeradius.org>
Tue, 6 Apr 2021 13:05:56 +0000 (09:05 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 22 Jul 2021 13:55:25 +0000 (09:55 -0400)
in which case it proxies to the first one it can, NOT to all
of them.

This loop allows for a reverse *proxy* to say "any of these N
keys can return CoA packets to ream FOO".

src/main/process.c

index 278212ef0f0ca351408700e2f07316198af98373..1b590d55ac5e99d252e77b9bbea25600fd7d59ee 100644 (file)
@@ -3219,7 +3219,20 @@ static int request_will_proxy(REQUEST *request)
                 *      This function will set request->home_server,
                 *      and also request->proxy_listener.
                 */
-               if (listen_coa_find(request, vp->vp_strvalue) < 0) return 0;
+               if (listen_coa_find(request, vp->vp_strvalue) < 0) {
+                       vp_cursor_t cursor;
+
+                       (void) fr_cursor_init(&cursor, &request->config); /* already checked it above */
+                       
+                       while ((vp = fr_cursor_next(&cursor)) != NULL) {
+                               if (listen_coa_find(request, vp->vp_strvalue) == 0) break;
+                       }
+
+                       /*
+                        *      Not found.
+                        */
+                       return 0;
+               }
 
                /*
                 *      Initialise request->proxy, and copy VPs over.