From: Alan T. DeKok Date: Thu, 1 Apr 2021 18:37:29 +0000 (-0400) Subject: respect Proxy-To-Originating-Realm in request_coa_originate() X-Git-Tag: release_3_0_24~153 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72e89c6a6ea1669e5fbcb12f2898d35eb66e13cf;p=thirdparty%2Ffreeradius-server.git respect Proxy-To-Originating-Realm in request_coa_originate() this isn't entirely the correct name for how we use the attribute, but it's at least consistent with the rest of the server. --- diff --git a/src/main/process.c b/src/main/process.c index 6a3bfd20ba1..df32903117c 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -4356,6 +4356,26 @@ static void request_coa_originate(REQUEST *request) coa = request->coa; coa->listener = NULL; /* copied here by request_alloc_fake(), but not needed */ +#ifdef WITH_COA_TUNNEL + /* + * Proxy-To-Originating-Realm is preferred to any other + * method of originating CoA requests. + */ + vp = fr_pair_find_by_num(coa->config, PW_PROXY_TO_ORIGINATING_REALM, 0, TAG_ANY); + if (vp) { + /* + * This function will set request->home_server, + * and also request->proxy_listener. + */ + if (listen_coa_find(coa, vp->vp_strvalue) < 0) { + RWDEBUG("Unknown Originating realm '%s'", vp->vp_strvalue); + return; + } + + goto set_packet_type; + } +#endif + /* * src_ipaddr will be set up in proxy_encode. */ @@ -4421,6 +4441,9 @@ static void request_coa_originate(REQUEST *request) } } +#ifdef WITH_COA_TUNNEL +set_packet_type: +#endif vp = fr_pair_find_by_num(coa->proxy->vps, PW_PACKET_TYPE, 0, TAG_ANY); if (vp) { switch (vp->vp_integer) {