#include "rlm_eap.h"
static const CONF_PARSER module_config[] = {
- { "default_eap_type", PW_TYPE_STRING_PTR,
- offsetof(rlm_eap_t, default_method_name), NULL, "md5" },
- { "timer_expire", PW_TYPE_INTEGER,
- offsetof(rlm_eap_t, timer_limit), NULL, "60"},
- { "ignore_unknown_eap_types", PW_TYPE_BOOLEAN,
- offsetof(rlm_eap_t, ignore_unknown_types), NULL, "no" },
- { "mod_accounting_username_bug", PW_TYPE_BOOLEAN,
- offsetof(rlm_eap_t, mod_accounting_username_bug), NULL, "no" },
- { "max_sessions", PW_TYPE_INTEGER,
- offsetof(rlm_eap_t, max_sessions), NULL, "2048"},
+ { "default_eap_type", FR_CONF_OFFSET(PW_TYPE_STRING, rlm_eap_t, default_method_name), "md5" },
+ { "timer_expire", FR_CONF_OFFSET(PW_TYPE_INTEGER, rlm_eap_t, timer_limit), "60" },
+ { "ignore_unknown_eap_types", FR_CONF_OFFSET(PW_TYPE_BOOLEAN, rlm_eap_t, ignore_unknown_types), "no" },
+ { "mod_accounting_username_bug", FR_CONF_OFFSET(PW_TYPE_BOOLEAN, rlm_eap_t, mod_accounting_username_bug), "no" },
+ { "max_sessions", FR_CONF_OFFSET(PW_TYPE_INTEGER, rlm_eap_t, max_sessions), "2048" },
{ NULL, -1, 0, NULL, NULL } /* end the list */
};
#endif
rbtree_free(inst->session_tree);
- if (inst->handler_tree) rbtree_free(inst->handler_tree);
+ if (inst->handler_tree) {
+ rbtree_free(inst->handler_tree);
+ /*
+ * Must be NULL else when nodes are freed they try to
+ * delete themselves from the tree.
+ */
+ inst->handler_tree = NULL;
+ }
inst->session_tree = NULL;
eaplist_free(inst);
* EAP work.
*/
if (fr_ipaddr_cmp(&one->src_ipaddr, &two->src_ipaddr) != 0) {
- WDEBUG("EAP packets are arriving from two different upstream "
+ WARN("EAP packets are arriving from two different upstream "
"servers. Has there been a proxy fail-over?");
}
* Lookup sessions in the tree. We don't free them in
* the tree, as that's taken care of elsewhere...
*/
- inst->session_tree = rbtree_create(eap_handler_cmp, NULL, 0);
+ inst->session_tree = rbtree_create(NULL, eap_handler_cmp, NULL, 0);
if (!inst->session_tree) {
ERROR("rlm_eap (%s): Cannot initialize tree", inst->xlat_name);
return -1;
}
+ fr_link_talloc_ctx_free(inst, inst->session_tree);
if (fr_debug_flag) {
- inst->handler_tree = rbtree_create(eap_handler_ptr_cmp, NULL, 0);
+ inst->handler_tree = rbtree_create(NULL, eap_handler_ptr_cmp, NULL, 0);
if (!inst->handler_tree) {
ERROR("rlm_eap (%s): Cannot initialize tree", inst->xlat_name);
return -1;
}
+ fr_link_talloc_ctx_free(inst, inst->handler_tree);
#ifdef HAVE_PTHREAD_H
if (pthread_mutex_init(&(inst->handler_mutex), NULL) < 0) {
/*
* If we're doing horrible tunneling work, remember it.
*/
- if ((request->options & RAD_REQUEST_OPTION_PROXY_EAP) != 0) {
- RDEBUG2(" Not-EAP proxy set. Not composing EAP");
+ if ((request->log.lvl & RAD_REQUEST_OPTION_PROXY_EAP) != 0) {
+ RDEBUG2("No EAP proxy set. Not composing EAP");
/*
* Add the handle to the proxied list, so that we
* can retrieve it in the post-proxy stage, and
*/
pairdelete(&request->proxy->vps, PW_FREERADIUS_PROXIED_TO, VENDORPEC_FREERADIUS, TAG_ANY);
- RDEBUG2(" Tunneled session will be proxied. Not doing EAP.");
+ RDEBUG2("Tunneled session will be proxied. Not doing EAP");
return RLM_MODULE_HANDLED;
}
#endif
* says that we MUST include a User-Name attribute in the
* Access-Accept.
*/
- if ((request->reply->code == PW_CODE_AUTHENTICATION_ACK) &&
+ if ((request->reply->code == PW_CODE_ACCESS_ACCEPT) &&
request->username) {
VALUE_PAIR *vp;
vp_cursor_t cursor;
/*
- * Just in case the admin lists EAP in post-proxy-type Fail.
- */
- if (!request->proxy_reply) return RLM_MODULE_NOOP;
-
- /*
* If there was a handler associated with this request,
* then it's a tunneled request which was proxied...
*/
* says that we MUST include a User-Name attribute in the
* Access-Accept.
*/
- if ((request->reply->code == PW_CODE_AUTHENTICATION_ACK) &&
+ if ((request->reply->code == PW_CODE_ACCESS_ACCEPT) &&
request->username) {
/*
* Doesn't exist, add it in.