summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/radius/acct.c5
-rw-r--r--accel-pppd/radius/radius.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c
index ddb3e086..cbb23d53 100644
--- a/accel-pppd/radius/acct.c
+++ b/accel-pppd/radius/acct.c
@@ -15,6 +15,7 @@
#include "memdebug.h"
#define STAT_UPDATE_INTERVAL (10 * 60 * 1000)
+#define INTERIM_SAFE_TIME 10
static int req_set_RA(struct rad_req_t *req, const char *secret)
{
@@ -150,6 +151,10 @@ static void rad_acct_interim_update(struct triton_timer_t *t)
if (rpd->acct_req->timeout.tpd)
return;
+ if (rpd->session_timeout.expire_tv.tv_sec &&
+ rpd->session_timeout.expire_tv.tv_sec - (time(NULL) - rpd->ppp->start_time) < INTERIM_SAFE_TIME)
+ return;
+
req_set_stat(rpd->acct_req, rpd->ppp);
if (!rpd->acct_interim_interval)
return;
diff --git a/accel-pppd/radius/radius.c b/accel-pppd/radius/radius.c
index 8976a330..04de1b79 100644
--- a/accel-pppd/radius/radius.c
+++ b/accel-pppd/radius/radius.c
@@ -88,7 +88,7 @@ int rad_proc_attrs(struct rad_req_t *req)
req->rpd->acct_interim_interval = attr->val.integer;
break;
case Session_Timeout:
- req->rpd->session_timeout.period = attr->val.integer * 1000;
+ req->rpd->session_timeout.expire_tv.tv_sec = attr->val.integer;
break;
case Class:
if (!req->rpd->attr_class)
@@ -198,7 +198,7 @@ static void ppp_acct_start(struct ppp_t *ppp)
return;
}
- if (rpd->session_timeout.period) {
+ if (rpd->session_timeout.expire_tv.tv_sec) {
rpd->session_timeout.expire = session_timeout;
triton_timer_add(ppp->ctrl->ctx, &rpd->session_timeout, 0);
}