summaryrefslogtreecommitdiff
path: root/accel-pppd/extra
diff options
context:
space:
mode:
authorStephan Brunner <s.brunner@stephan-brunner.net>2022-11-01 09:51:14 +0100
committerStephan Brunner <s.brunner@stephan-brunner.net>2022-11-01 09:51:34 +0100
commitffe3a1337c1380a5b79651b34037c6c9f66b9ea1 (patch)
tree077d1e424913b5a55e621a842215baea1739535c /accel-pppd/extra
parentf4a22056a221d69bf8d1aaa8eca39f276b52431d (diff)
downloadaccel-ppp-ffe3a1337c1380a5b79651b34037c6c9f66b9ea1.tar.gz
accel-ppp-ffe3a1337c1380a5b79651b34037c6c9f66b9ea1.zip
Use 64-bit interface statistics rather than doing custom 32-bit overflow handling.
When a link has a relatively high throughput, the 32-bit packet and byte counters could overflow multiple times between accounting runs. To accommodate this limitation, directly use 64-bit interface statistics. This also gets rid of the internal giga-word counters.
Diffstat (limited to 'accel-pppd/extra')
-rw-r--r--accel-pppd/extra/pppd_compat.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c
index 663e545..9bc393b 100644
--- a/accel-pppd/extra/pppd_compat.c
+++ b/accel-pppd/extra/pppd_compat.c
@@ -684,12 +684,11 @@ static void fill_env(char **env, char *mem, struct pppd_compat_pd *pd)
}
if (pd->ses->stop_time) {
- uint64_t gword_sz = (uint64_t)UINT32_MAX + 1;
uint64_t tx_bytes;
uint64_t rx_bytes;
- tx_bytes = ses->acct_tx_bytes + gword_sz * ses->acct_output_gigawords;
- rx_bytes = ses->acct_rx_bytes + gword_sz * ses->acct_input_gigawords;
+ tx_bytes = ses->acct_tx_bytes;
+ rx_bytes = ses->acct_rx_bytes;
env[n] = mem;
write_sz = snprintf(mem, mem_sz, "CONNECT_TIME=%lu",