summaryrefslogtreecommitdiff
path: root/accel-pppd/lua
diff options
context:
space:
mode:
authorxebd <xeb@mail.ru>2022-11-01 16:20:36 +0300
committerGitHub <noreply@github.com>2022-11-01 16:20:36 +0300
commita6aa7c279d2713c6723731029092199713d21257 (patch)
treed3a00c4926246b49cb0dc86300b936ebed849254 /accel-pppd/lua
parentadfc132b96a4fbfb3a10f49e04e15c6669abf11d (diff)
parentad94c19554d7c6bb18ab2e251e4ee403ee0b7732 (diff)
downloadaccel-ppp-a6aa7c279d2713c6723731029092199713d21257.tar.gz
accel-ppp-a6aa7c279d2713c6723731029092199713d21257.zip
Merge pull request #66 from boomer41/feature/additions-2022-11-01
Use 64-bit interface statistics and some more env parameters for pppd-compat
Diffstat (limited to 'accel-pppd/lua')
-rw-r--r--accel-pppd/lua/session.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/accel-pppd/lua/session.c b/accel-pppd/lua/session.c
index a6ce2b08..6d3b6762 100644
--- a/accel-pppd/lua/session.c
+++ b/accel-pppd/lua/session.c
@@ -218,13 +218,12 @@ static int session_ipv6(lua_State *L)
static int session_rx_bytes(lua_State *L)
{
struct ap_session *ses = luaL_checkudata(L, 1, LUA_AP_SESSION);
- uint64_t gword_sz = (uint64_t)UINT32_MAX + 1;
uint64_t bytes;
if (!ses)
return 0;
- bytes = gword_sz*ses->acct_input_gigawords + ses->acct_rx_bytes;
+ bytes = ses->acct_rx_bytes;
lua_pushnumber(L, bytes);
return 1;
@@ -233,13 +232,12 @@ static int session_rx_bytes(lua_State *L)
static int session_tx_bytes(lua_State *L)
{
struct ap_session *ses = luaL_checkudata(L, 1, LUA_AP_SESSION);
- uint64_t gword_sz = (uint64_t)UINT32_MAX + 1;
uint64_t bytes;
if (!ses)
return 0;
- bytes = gword_sz*ses->acct_output_gigawords + ses->acct_tx_bytes;
+ bytes = ses->acct_tx_bytes;
lua_pushnumber(L, bytes);
return 1;