summaryrefslogtreecommitdiff
path: root/accel-pptpd/radius/radius.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2010-10-26 15:18:56 +0400
committerDmitry Kozlov <xeb@mail.ru>2010-10-26 15:18:56 +0400
commit0d7463621ef7ce5c1df0a427c23d6936f1c43ab7 (patch)
treec804086137c76e7cbfe6c41dacfb8c1de48a24ec /accel-pptpd/radius/radius.c
parent098a5112a9e2240fdbac3116173f6735ee13dba8 (diff)
downloadaccel-ppp-0d7463621ef7ce5c1df0a427c23d6936f1c43ab7.tar.gz
accel-ppp-0d7463621ef7ce5c1df0a427c23d6936f1c43ab7.zip
radius: implemented Acct-Delay-Time attribute
radius: accounting start moved to before ip up
Diffstat (limited to 'accel-pptpd/radius/radius.c')
-rw-r--r--accel-pptpd/radius/radius.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/accel-pptpd/radius/radius.c b/accel-pptpd/radius/radius.c
index 45f0ba9..f24724f 100644
--- a/accel-pptpd/radius/radius.c
+++ b/accel-pptpd/radius/radius.c
@@ -138,12 +138,14 @@ static void ppp_starting(struct ppp_t *ppp)
pthread_rwlock_unlock(&sessions_lock);
}
-static void ppp_started(struct ppp_t *ppp)
+static void ppp_acct_start(struct ppp_t *ppp)
{
struct radius_pd_t *rpd = find_pd(ppp);
- if (rad_acct_start(rpd))
+ if (rad_acct_start(rpd)) {
ppp_terminate(rpd->ppp, TERM_NAS_ERROR, 0);
+ return;
+ }
if (rpd->session_timeout.expire_tv.tv_sec) {
rpd->session_timeout.expire = session_timeout;
@@ -367,7 +369,7 @@ static void __init radius_init(void)
ipdb_register(&ipdb);
triton_event_register_handler(EV_PPP_STARTING, (triton_event_func)ppp_starting);
- triton_event_register_handler(EV_PPP_STARTED, (triton_event_func)ppp_started);
+ triton_event_register_handler(EV_PPP_ACCT_START, (triton_event_func)ppp_acct_start);
triton_event_register_handler(EV_PPP_FINISHING, (triton_event_func)ppp_finishing);
triton_event_register_handler(EV_PPP_FINISHED, (triton_event_func)ppp_finished);
}