]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use define for Service-Type value check 1159/head
authorHerwin Weststrate <herwin@quarantainenet.nl>
Wed, 22 Jul 2015 09:57:16 +0000 (11:57 +0200)
committerHerwin Weststrate <herwin@quarantainenet.nl>
Wed, 22 Jul 2015 09:57:16 +0000 (11:57 +0200)
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.

src/include/radius.h
src/main/listen.c

index 186e596986e2adc45fc07aef2717d309a4dce801..12fa78dde4fb5f1bc695e46034e7a7017564a682 100644 (file)
@@ -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        */
 
index 3bb42e4027cd151b9b21ad9212d684fc6724c03a..3cba3e71be15367f7a60a17f8684e7e7d0f8d3ee 100644 (file)
@@ -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");