From: Alan T. DeKok Date: Tue, 6 Apr 2021 13:05:56 +0000 (-0400) Subject: allow multiple Proxy-To-Originating-Realm keys X-Git-Tag: release_3_0_24~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=478be465407d6da9e20762aa896a2ba2ea76de53;p=thirdparty%2Ffreeradius-server.git allow multiple Proxy-To-Originating-Realm keys 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". --- diff --git a/src/main/process.c b/src/main/process.c index 278212ef0f0..1b590d55ac5 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -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.