diff options
Diffstat (limited to 'accel-pppd/auth/auth_pap.c')
-rw-r--r-- | accel-pppd/auth/auth_pap.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/accel-pppd/auth/auth_pap.c b/accel-pppd/auth/auth_pap.c index e051dd72..45f9e48d 100644 --- a/accel-pppd/auth/auth_pap.c +++ b/accel-pppd/auth/auth_pap.c @@ -4,6 +4,7 @@ #include <arpa/inet.h> #include "log.h" +#include "events.h" #include "ppp.h" #include "ppp_auth.h" #include "ppp_lcp.h" @@ -265,19 +266,26 @@ static void pap_recv(struct ppp_handler_t *h) } } -static void auth_pap_init() +static void load_config(void) { - char *opt; + const char *opt; opt = conf_get_opt("auth", "timeout"); if (opt && atoi(opt) > 0) conf_timeout = atoi(opt); opt = conf_get_opt("auth", "any-login"); - if (opt && atoi(opt) > 0) - conf_any_login = 1; + if (opt) + conf_any_login = atoi(opt); +} + +static void auth_pap_init() +{ + load_config(); ppp_auth_register_handler(&pap); + + triton_event_register_handler(EV_CONFIG_RELOAD, (triton_event_func)load_config); } DEFINE_INIT(7, auth_pap_init); |