diff options
author | Kozlov Dmitry <dima@server> | 2011-06-02 13:30:45 +0400 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2011-06-02 13:30:45 +0400 |
commit | 3126cd8c4a5e43e382f773fc1a2045eef5b740a2 (patch) | |
tree | 50697fb8101fd178f3d4af4fb94d5c441a07f6f0 /accel-pppd/ppp/ppp_auth.c | |
parent | 779348ad22a6ec3d10ee7ffe47eef2887b183ef6 (diff) | |
download | accel-ppp-3126cd8c4a5e43e382f773fc1a2045eef5b740a2.tar.gz accel-ppp-3126cd8c4a5e43e382f773fc1a2045eef5b740a2.zip |
ppp: make auth layer started after authentication acknowledge packet sent
Diffstat (limited to 'accel-pppd/ppp/ppp_auth.c')
-rw-r--r-- | accel-pppd/ppp/ppp_auth.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/accel-pppd/ppp/ppp_auth.c b/accel-pppd/ppp/ppp_auth.c index e02d8c1e..c8f3b95a 100644 --- a/accel-pppd/ppp/ppp_auth.c +++ b/accel-pppd/ppp/ppp_auth.c @@ -304,6 +304,16 @@ static void ppp_terminate_sec(struct ppp_t *ppp) ppp_terminate(ppp, TERM_NAS_REQUEST, 0); } +static void __ppp_auth_started(struct ppp_t *ppp) +{ + struct auth_layer_data_t *ad = container_of(ppp_find_layer_data(ppp, &auth_layer), typeof(*ad), ld); + + log_ppp_debug("auth_layer_started\n"); + ppp_layer_started(ppp, &ad->ld); + log_ppp_info1("%s: authentication successed\n", ppp->username); + triton_event_fire(EV_PPP_AUTHORIZED, ppp); +} + int __export ppp_auth_successed(struct ppp_t *ppp, char *username) { struct ppp_t *p; @@ -329,10 +339,7 @@ int __export ppp_auth_successed(struct ppp_t *ppp, char *username) ppp->username = username; pthread_rwlock_unlock(&ppp_lock); - log_ppp_debug("auth_layer_started\n"); - ppp_layer_started(ppp, &ad->ld); - log_ppp_info1("%s: authentication successed\n", username); - triton_event_fire(EV_PPP_AUTHORIZED, ppp); + triton_context_call(ppp->ctrl->ctx, (triton_event_func)__ppp_auth_started, ppp); return 0; } |