summaryrefslogtreecommitdiff
path: root/accel-pppd/radius/acct.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/radius/acct.c')
-rw-r--r--accel-pppd/radius/acct.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c
index 9300bcb8..8b3f95d5 100644
--- a/accel-pppd/radius/acct.c
+++ b/accel-pppd/radius/acct.c
@@ -41,7 +41,7 @@ static int req_set_RA(struct rad_req_t *req, const char *secret)
static int req_set_stat(struct rad_req_t *req, struct ap_session *ses)
{
- struct rtnl_link_stats stats;
+ struct rtnl_link_stats64 stats;
struct radius_pd_t *rpd = req->rpd;
struct timespec ts;
int ret = 0;
@@ -52,12 +52,12 @@ static int req_set_stat(struct rad_req_t *req, struct ap_session *ses)
clock_gettime(CLOCK_MONOTONIC, &ts);
if (ap_session_read_stats(ses, &stats) == 0) {
- rad_packet_change_int(req->pack, NULL, "Acct-Input-Octets", stats.rx_bytes);
- rad_packet_change_int(req->pack, NULL, "Acct-Output-Octets", stats.tx_bytes);
- rad_packet_change_int(req->pack, NULL, "Acct-Input-Packets", stats.rx_packets);
- rad_packet_change_int(req->pack, NULL, "Acct-Output-Packets", stats.tx_packets);
- rad_packet_change_int(req->pack, NULL, "Acct-Input-Gigawords", rpd->ses->acct_input_gigawords);
- rad_packet_change_int(req->pack, NULL, "Acct-Output-Gigawords", rpd->ses->acct_output_gigawords);
+ rad_packet_change_int(req->pack, NULL, "Acct-Input-Octets", (int) (stats.rx_bytes & UINT32_MAX));
+ rad_packet_change_int(req->pack, NULL, "Acct-Output-Octets", (int) (stats.tx_bytes & UINT32_MAX));
+ rad_packet_change_int(req->pack, NULL, "Acct-Input-Packets", (int) (stats.rx_packets & UINT32_MAX));
+ rad_packet_change_int(req->pack, NULL, "Acct-Output-Packets", (int) (stats.tx_packets & UINT32_MAX));
+ rad_packet_change_int(req->pack, NULL, "Acct-Input-Gigawords", (int) (stats.rx_bytes >> (sizeof(uint32_t) * 8)));
+ rad_packet_change_int(req->pack, NULL, "Acct-Output-Gigawords", (int) (stats.tx_bytes >> (sizeof(uint32_t) * 8)));
} else
ret = -1;