Skip to content

Commit

Permalink
use new API for fr_dict_enum_by_value()
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Dec 9, 2019
1 parent be08875 commit 42cd02b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/proto_radius/proto_radius_auth.c
Expand Up @@ -400,7 +400,7 @@ static rlm_rcode_t mod_process(void const *instance, REQUEST *request)
* Find the appropriate Auth-Type by name.
*/
vp = auth_type;
dv = fr_dict_enum_by_value(vp->da, &vp->data);
dv = fr_dict_dict_enum_by_value(dict_freeradius, vp->da, &vp->data);
if (!dv) {
REDEBUG2("Unknown Auth-Type %d found: rejecting the user", vp->vp_uint32);
request->reply->code = FR_CODE_ACCESS_REJECT;
Expand Down Expand Up @@ -513,7 +513,7 @@ static rlm_rcode_t mod_process(void const *instance, REQUEST *request)
}
}

dv = fr_dict_enum_by_value(attr_packet_type, fr_box_uint32(request->reply->code));
dv = fr_dict_dict_enum_by_value(dict_radius, attr_packet_type, fr_box_uint32(request->reply->code));
unlang = NULL;
if (dv) unlang = cf_section_find(request->server_cs, "send", dv->name);

Expand Down Expand Up @@ -562,13 +562,13 @@ static rlm_rcode_t mod_process(void const *instance, REQUEST *request)
* the NAK section.
*/
if (request->reply->code != FR_CODE_ACCESS_REJECT) {
dv = fr_dict_enum_by_value(attr_packet_type, fr_box_uint32(request->reply->code));
dv = fr_dict_dict_enum_by_value(dict_radius, attr_packet_type, fr_box_uint32(request->reply->code));

RWDEBUG("Failed running 'send %s', trying 'send Access-Reject'", dv ? dv->name : "???" );

request->reply->code = FR_CODE_ACCESS_REJECT;

dv = fr_dict_enum_by_value(attr_packet_type, fr_box_uint32(request->reply->code));
dv = fr_dict_dict_enum_by_value(dict_radius, attr_packet_type, fr_box_uint32(request->reply->code));
unlang = NULL;
if (!dv) goto send_reply;

Expand Down

1 comment on commit 42cd02b

@alandekok
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.