aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2012-12-17 18:28:56 +0100
committerPatrik Nyblom <[email protected]>2013-01-23 16:01:34 +0100
commit07717cc4feac09d4f00f9859550996cc6dd4a89b (patch)
tree570c4d8fd7551375ce37383a0cea628ed0aaa8c0 /erts/emulator/drivers
parent13735fd978b94225c7c3285c763314f6d2d5d736 (diff)
downloadotp-07717cc4feac09d4f00f9859550996cc6dd4a89b.tar.gz
otp-07717cc4feac09d4f00f9859550996cc6dd4a89b.tar.bz2
otp-07717cc4feac09d4f00f9859550996cc6dd4a89b.zip
Fix inet_drv _oct counters 32bit/64bit bug
Diffstat (limited to 'erts/emulator/drivers')
-rw-r--r--erts/emulator/drivers/common/inet_drv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c
index 5f8837fd4f..c284a8aa86 100644
--- a/erts/emulator/drivers/common/inet_drv.c
+++ b/erts/emulator/drivers/common/inet_drv.c
@@ -7885,7 +7885,7 @@ static ErlDrvSSizeT inet_ctl(inet_descriptor* desc, int cmd, char* buf,
static void inet_output_count(inet_descriptor* desc, ErlDrvSizeT len)
{
unsigned long n = desc->send_cnt + 1;
- unsigned long t = desc->send_oct[0] + len;
+ unsigned long t = (desc->send_oct[0] + len) & 0xFFFFFFFFUL;
int c = (t < desc->send_oct[0]);
double avg = desc->send_avg;
@@ -7905,7 +7905,7 @@ static void inet_output_count(inet_descriptor* desc, ErlDrvSizeT len)
static void inet_input_count(inet_descriptor* desc, ErlDrvSizeT len)
{
unsigned long n = desc->recv_cnt + 1;
- unsigned long t = desc->recv_oct[0] + len;
+ unsigned long t = (desc->recv_oct[0] + len) & 0xFFFFFFFFUL;
int c = (t < desc->recv_oct[0]);
double avg = desc->recv_avg;
double dvi;