Skip to content

Commit

Permalink
Use define for Service-Type value check
Browse files Browse the repository at this point in the history
The value 17 (Authorize-Only) has been added in RFC3576, the other values were already present in RFC 2865, most likely that's the reason the symbolic name was missing.
  • Loading branch information
qnet-herwin committed Jul 22, 2015
1 parent cba3cbe commit 0e33d2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/include/radius.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ typedef enum {
#define PW_NAS_PROMPT_USER 7
#define PW_AUTHENTICATE_ONLY 8
#define PW_CALLBACK_NAS_PROMPT 9
#define PW_AUTHORIZE_ONLY 17

/* Framed Protocols */

Expand Down
2 changes: 1 addition & 1 deletion src/main/listen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1779,7 +1779,7 @@ int rad_coa_recv(REQUEST *request)
*/
vp = fr_pair_find_by_num(request->packet->vps, PW_SERVICE_TYPE, 0, TAG_ANY);
if (request->packet->code == PW_CODE_COA_REQUEST) {
if (vp && (vp->vp_integer == 17)) {
if (vp && (vp->vp_integer == PW_AUTHORIZE_ONLY)) {
vp = fr_pair_find_by_num(request->packet->vps, PW_STATE, 0, TAG_ANY);
if (!vp || (vp->vp_length == 0)) {
REDEBUG("CoA-Request with Service-Type = Authorize-Only MUST contain a State attribute");
Expand Down

0 comments on commit 0e33d2e

Please sign in to comment.