From: Alan T. DeKok Date: Fri, 18 Feb 2011 09:01:11 +0000 (+0100) Subject: Make CoA proxying work again. X-Git-Tag: release_2_1_11~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d0636d145c0bdd34057f6aa5977e1fa6893aa61;p=thirdparty%2Ffreeradius-server.git Make CoA proxying work again. Only set the reply code if it isn't meant to be proxied. --- diff --git a/src/main/listen.c b/src/main/listen.c index 071bd5b79ba..6e4f88dbc9b 100644 --- a/src/main/listen.c +++ b/src/main/listen.c @@ -986,6 +986,27 @@ static int rad_coa_reply(REQUEST *request) return RLM_MODULE_OK; } +static int do_proxy(REQUEST *request) +{ + VALUE_PAIR *vp; + + if (request->in_proxy_hash || + (request->proxy_reply && (request->proxy_reply->code != 0))) { + return 0; + } + + vp = pairfind(request->config_items, PW_HOME_SERVER_POOL); + if (!vp) return 0; + + if (!home_pool_byname(vp->vp_strvalue, HOME_TYPE_COA)) { + RDEBUG2("ERROR: Cannot proxy to unknown pool %s", + vp->vp_strvalue); + return 0; + } + + return 1; +} + /* * Receive a CoA packet. */ @@ -1061,6 +1082,7 @@ static int rad_coa_recv(REQUEST *request) case RLM_MODULE_NOTFOUND: case RLM_MODULE_OK: case RLM_MODULE_UPDATED: + if (do_proxy(request)) return RLM_MODULE_OK; request->reply->code = ack; break; }