From 609af350ace3c284af7bec0b5c27c59a8eff4b8c Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Tue, 20 Sep 2011 11:06:42 +0400 Subject: auth: implemented noauth option --- accel-pppd/ppp/ppp_auth.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'accel-pppd') diff --git a/accel-pppd/ppp/ppp_auth.c b/accel-pppd/ppp/ppp_auth.c index 425a31a..98675d3 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); -- cgit v1.2.3