diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2011-09-20 11:06:42 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2011-09-20 11:06:42 +0400 |
commit | 609af350ace3c284af7bec0b5c27c59a8eff4b8c (patch) | |
tree | 28468de505d16a04f7154f3f4875648aca614d70 /accel-pppd/ppp/ppp_auth.c | |
parent | 2070b2af1bd1a259946df6af8ede04f51e9f759c (diff) | |
download | accel-ppp-609af350ace3c284af7bec0b5c27c59a8eff4b8c.tar.gz accel-ppp-609af350ace3c284af7bec0b5c27c59a8eff4b8c.zip |
auth: implemented noauth option
Diffstat (limited to 'accel-pppd/ppp/ppp_auth.c')
-rw-r--r-- | accel-pppd/ppp/ppp_auth.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/accel-pppd/ppp/ppp_auth.c b/accel-pppd/ppp/ppp_auth.c index 425a31a4..98675d37 100644 --- a/accel-pppd/ppp/ppp_auth.c +++ b/accel-pppd/ppp/ppp_auth.c @@ -16,6 +16,7 @@ static LIST_HEAD(auth_handlers); static int extra_opt_len = 0; +static int conf_noauth = 0; static struct lcp_option_t *auth_init(struct ppp_lcp_t *lcp); static void auth_free(struct ppp_lcp_t *lcp, struct lcp_option_t *opt); @@ -116,7 +117,7 @@ static int auth_send_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, u struct auth_data_t *d; int n; - if (list_empty(&auth_opt->auth_list)) + if (list_empty(&auth_opt->auth_list) || conf_noauth) return 0; if (!auth_opt->auth || auth_opt->auth->state == LCP_OPT_NAK) { @@ -409,10 +410,23 @@ int __export ppp_auth_restart(struct ppp_t *ppp) return 0; } +static void load_config(void) +{ + const char *opt; + + opt = conf_get_opt("auth", "noauth"); + if (opt) + conf_noauth = atoi(opt); +} + static void ppp_auth_init() { + load_config(); + ppp_register_layer("auth", &auth_layer); lcp_option_register(&auth_opt_hnd); + + triton_event_register_handler(EV_CONFIG_RELOAD, (triton_event_func)load_config); } DEFINE_INIT(3, ppp_auth_init); |