summaryrefslogtreecommitdiff
path: root/accel-pppd/auth/auth_chap_md5.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/auth/auth_chap_md5.c')
-rw-r--r--accel-pppd/auth/auth_chap_md5.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/accel-pppd/auth/auth_chap_md5.c b/accel-pppd/auth/auth_chap_md5.c
index 309af8a6..ae062f53 100644
--- a/accel-pppd/auth/auth_chap_md5.c
+++ b/accel-pppd/auth/auth_chap_md5.c
@@ -265,14 +265,18 @@ static void auth_result(struct chap_auth_data *ad, int res)
} else
ppp_auth_failed(ad->ppp, name);
} else {
- if (ppp_auth_succeeded(ad->ppp, name)) {
- chap_send_failure(ad);
- ap_session_terminate(&ad->ppp->ses, TERM_AUTH_ERROR, 0);
+ if (!ad->started) {
+ if (ppp_auth_succeeded(ad->ppp, name)) {
+ chap_send_failure(ad);
+ ap_session_terminate(&ad->ppp->ses, TERM_AUTH_ERROR, 0);
+ } else {
+ chap_send_success(ad, ad->id);
+ ad->started = 1;
+ if (conf_interval)
+ triton_timer_add(ad->ppp->ses.ctrl->ctx, &ad->interval, 0);
+ }
} else {
chap_send_success(ad, ad->id);
- ad->started = 1;
- if (conf_interval)
- triton_timer_add(ad->ppp->ses.ctrl->ctx, &ad->interval, 0);
}
}