summaryrefslogtreecommitdiff
path: root/accel-pptpd
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2010-10-27 15:47:13 +0400
committerKozlov Dmitry <dima@server>2010-10-27 15:47:13 +0400
commit0d2a0aafea94e33cfaa19948eb7e4dd1e62fce5e (patch)
tree4c3a5068d16a052d44897972042c0b60aebbf253 /accel-pptpd
parent0d7463621ef7ce5c1df0a427c23d6936f1c43ab7 (diff)
downloadaccel-ppp-0d2a0aafea94e33cfaa19948eb7e4dd1e62fce5e.tar.gz
accel-ppp-0d2a0aafea94e33cfaa19948eb7e4dd1e62fce5e.zip
radius: fixed incorrect Acct-Session-Time in Interim-Update packets
Diffstat (limited to 'accel-pptpd')
-rw-r--r--accel-pptpd/radius/acct.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/accel-pptpd/radius/acct.c b/accel-pptpd/radius/acct.c
index 77f38123..85a2f0fc 100644
--- a/accel-pptpd/radius/acct.c
+++ b/accel-pptpd/radius/acct.c
@@ -34,6 +34,12 @@ static int req_set_RA(struct rad_req_t *req, const char *secret)
static void req_set_stat(struct rad_req_t *req, struct ppp_t *ppp)
{
struct ifpppstatsreq ifreq;
+ time_t stop_time;
+
+ if (ppp->stop_time)
+ stop_time = ppp->stop_time;
+ else
+ time(&stop_time);
memset(&ifreq, 0, sizeof(ifreq));
ifreq.stats_ptr = (void *)&ifreq.stats;
@@ -58,7 +64,7 @@ static void req_set_stat(struct rad_req_t *req, struct ppp_t *ppp)
rad_packet_change_int(req->pack, "Acct-Output-Packets", ifreq.stats.p.ppp_opackets);
rad_packet_change_int(req->pack, "Acct-Input-Gigawords", req->rpd->acct_input_gigawords);
rad_packet_change_int(req->pack, "Acct-Output-Gigawords", req->rpd->acct_output_gigawords);
- rad_packet_change_int(req->pack, "Acct-Session-Time", ppp->stop_time - ppp->start_time);
+ rad_packet_change_int(req->pack, "Acct-Session-Time", stop_time - ppp->start_time);
}
static int rad_acct_read(struct triton_md_handler_t *h)