From: Arran Cudbard-Bell Date: Wed, 19 Dec 2012 18:06:05 +0000 (+0000) Subject: Set Post-Proxy-Type Reject if the request was rejected by the proxy server X-Git-Tag: release_2_2_1~203 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b9d3255154ac03381cdd73fbaf550380b3ac15e;p=thirdparty%2Ffreeradius-server.git Set Post-Proxy-Type Reject if the request was rejected by the proxy server --- diff --git a/src/main/event.c b/src/main/event.c index d839f8063d5..cd6dfce7f87 100644 --- a/src/main/event.c +++ b/src/main/event.c @@ -1719,6 +1719,24 @@ static int process_proxy_reply(REQUEST *request) * BEFORE playing games with the attributes. */ vp = pairfind(request->config_items, PW_POST_PROXY_TYPE); + + /* + * If we have a proxy_reply, and it was a reject, setup + * post-proxy-type Reject + */ + if (!vp && request->proxy_reply && + request->proxy_reply->code == PW_AUTHENTICATION_REJECT) { + DICT_VALUE *dval; + + dval = dict_valbyname(PW_POST_PROXY_TYPE, "Reject"); + if (!dval) return 0; + + vp = radius_paircreate(request, &request->config_items, + PW_POST_PROXY_TYPE, PW_TYPE_INTEGER); + + vp->vp_integer = dval->value; + } + if (vp) { RDEBUG2(" Found Post-Proxy-Type %s", vp->vp_strvalue); post_proxy_type = vp->vp_integer;