Skip to content

Commit

Permalink
Always respect control:Response-Packet-Type if it's present, no matte…
Browse files Browse the repository at this point in the history
…r what the request type was.

This allows:

accounting {
	update {
		control:Response-Packet-Type := Accounting-Response
	}
	handled
}

If you want to short circuit accounting. This is consistent with authentication behaviour.
  • Loading branch information
arr2036 committed Nov 27, 2013
1 parent 1f143bb commit 45988c8
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/main/process.c
Expand Up @@ -1072,23 +1072,23 @@ STATE_MACHINE_DECL(request_finish)
if (!request->in_request_hash) return;

/*
* Catch Auth-Type := Reject BEFORE proxying the packet.
* Override the response code if a control:Response-Packet-Type attribute is present.
*/
if (request->packet->code == PW_CODE_AUTHENTICATION_REQUEST) {
/*
* Override the response code if a
* control:Response-Packet-Type attribute is present.
*/
vp = pairfind(request->config_items, PW_RESPONSE_PACKET_TYPE, 0, TAG_ANY);
if (vp) {
if (vp->vp_integer == 256) {
RDEBUG2("Not responding to request");
vp = pairfind(request->config_items, PW_RESPONSE_PACKET_TYPE, 0, TAG_ANY);
if (vp) {
if (vp->vp_integer == 256) {
RDEBUG2("Not responding to request");

request->reply->code = 0;
} else {
request->reply->code = vp->vp_integer;
}
} else if (request->reply->code == 0) {
request->reply->code = 0;
} else {
request->reply->code = vp->vp_integer;
}
}
/*
* Catch Auth-Type := Reject BEFORE proxying the packet.
*/
else if (request->packet->code == PW_CODE_AUTHENTICATION_REQUEST) {
if (request->reply->code == 0) {
vp = pairfind(request->config_items, PW_AUTH_TYPE, 0, TAG_ANY);
if (!vp || (vp->vp_integer != PW_CODE_AUTHENTICATION_REJECT)) {
RDEBUG2("There was no response configured: "
Expand Down

0 comments on commit 45988c8

Please sign in to comment.