Advanced search
Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings AutoDisconnect
Summary Tracker Files

Bugs: Browse | Download .csv

[#6380] Disconnect fails when interface traffic exceeds 2 GiB

Please login

State:
Closed
Date:
2010-09-08 10:51
Priority:
3
Submitted By:
Pete Chapman (spanner)
Assigned To:
Aymeric Brisse (calvin_42)
Summary:
Disconnect fails when interface traffic exceeds 2 GiB

Detailed description
Once the interface has exceeded 2^31 bytes, the shell arithmetic in autodisconnect_runner_network can't keep up.

The line:

if [[ "$packets_after" -lt "$((packets_before+g_dontcountbytes))" ]]; then

wraps around, as an example (in ash), do:

bytes=2200000000; [[ "$bytes" -lt $((bytes + 2048)) ]] && echo "disconnect"

Attached is the patch I'm using (for v0.4.7) to work around this. It's a bit messy but I don't know any easy way to
do 64-bit arithmetic in a 32-bit shell (without invoking python!)

Followup

Message
Date: 2010-12-18 20:55
Sender: Aymeric Brisse

Fixed in 0.4.8 using bc (The GNU bc arbitrary precision calculator
language)

Attached Files:

Name Download
No Files Currently Attached

Changes:

Field Old Value Date By
ResolutionNone2010-12-18 20:55calvin_42
close_date2010-12-18 20:552010-12-18 20:55calvin_42
status_idOpen2010-12-18 20:55calvin_42
assigned_tonone2010-10-25 09:49calvin_42
File Added877: overflow.patch2010-09-08 10:51spanner

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment