netstat statistics overflow

Bug #597236 reported by puccha
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
net-tools (Debian)
Fix Released
Unknown
net-tools (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: net-tools

In netstat's summary "netstat -s" the fields 'InOctets' and 'OutOctets' appear to be a 32 bit signed value. When sending or receiving large amounts of packets the values occasionally wrap around and change sign.

$ netstat -s
...
IpExt:
...
    InOctets: 201874790
    OutOctets: -2029455654
...

The raw data however is correct:

$ cat /proc/net/dev
Inter-| Receive | Transmit
 face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
    lo: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  eth0:22360647 218274 0 0 0 0 0 5 76188265 129485 0 0 0 0 0 0
  lab0:11152431249 131487214 0 0 0 0 0 6 51840697004 129560924 0 0 0 0 0 0

Versions:
ubuntu 10.04 - x64_86
net-tools 1.60
netstat 1.42 (2001-04-15)

Netstat should use a bigger integer type, at the very least use an unsigned interger type.

Revision history for this message
Jiri Popelka (jpopelka) wrote :
Changed in net-tools (Debian):
importance: Undecided → Unknown
status: New → Unknown
Changed in net-tools (Debian):
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in net-tools (Ubuntu):
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

Re-confirmed in Precise.

The patch from Debian has been merged to upstream <http://net-tools.git.sourceforge.net/git/gitweb.cgi?p=net-tools/net-tools;a=commitdiff;h=f1f89328cccf92824ab436fa43068603eb43e34d>.

Since the last upstream release was eleven years ago, I don't think it's a good idea to wait for the next one. Maybe Ubuntu and Debian could cherrypick this fix or take a snapshot from trunk?

Changed in net-tools (Debian):
status: New → Fix Released
Revision history for this message
Ken Sharp (kennybobs) wrote :

The patch should have made it into Utopic+

tags: added: amd64 lucid patch-accepted-debian patch-accepted-upstream precise trusty
Revision history for this message
Robie Basak (racb) wrote :

This is reported as fixed in Debian net-tools 1.60-26, which is included in every Ubuntu release since Vivid. This means that it should be fixed in 16.04, 16.10 and the current development release (Zesty).

If this is incorrect, please reopen.

Changed in net-tools (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.