diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2011-09-20 11:06:54 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2011-09-20 11:06:54 +0400 |
commit | 19ac6b6c05c863136855c5577ee3b6e493c499a5 (patch) | |
tree | caeda3536d25a046cabfc772ff7f59ec3a0410bf /accel-pppd/auth/auth_mschap_v2.c | |
parent | 609af350ace3c284af7bec0b5c27c59a8eff4b8c (diff) | |
download | accel-ppp-xebd-19ac6b6c05c863136855c5577ee3b6e493c499a5.tar.gz accel-ppp-xebd-19ac6b6c05c863136855c5577ee3b6e493c499a5.zip |
auth: config reload
Diffstat (limited to 'accel-pppd/auth/auth_mschap_v2.c')
-rw-r--r-- | accel-pppd/auth/auth_mschap_v2.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/accel-pppd/auth/auth_mschap_v2.c b/accel-pppd/auth/auth_mschap_v2.c index 0dd4143..cb97207 100644 --- a/accel-pppd/auth/auth_mschap_v2.c +++ b/accel-pppd/auth/auth_mschap_v2.c @@ -618,6 +618,23 @@ static void chap_recv(struct ppp_handler_t *h) log_ppp_warn("mschap-v2: unknown code received %x\n",hdr->code); } +static void load_config(void) +{ + const char *opt; + + opt = conf_get_opt("auth", "timeout"); + if (opt && atoi(opt) > 0) + conf_timeout = atoi(opt); + + opt = conf_get_opt("auth", "interval"); + if (opt && atoi(opt) > 0) + conf_interval = atoi(opt); + + opt = conf_get_opt("auth", "max-failure"); + if (opt && atoi(opt) > 0) + conf_max_failure = atoi(opt); +} + static void auth_mschap_v2_init() { urandom_fd = open("/dev/urandom", O_RDONLY); @@ -626,8 +643,12 @@ static void auth_mschap_v2_init() return; } + load_config(); + if (ppp_auth_register_handler(&chap)) log_emerg("mschap-v2: failed to register handler\n"); + + triton_event_register_handler(EV_CONFIG_RELOAD, (triton_event_func)load_config); } DEFINE_INIT(4, auth_mschap_v2_init); |