Bug 154455 - 64bit network counters peg instead of wrapping
64bit network counters peg instead of wrapping
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-snmp (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
:
Depends On:
Blocks: 156320 156322
  Show dependency treegraph
 
Reported: 2005-04-11 17:28 EDT by Guy Streeter
Modified: 2016-02-09 20:32 EST (History)
2 users (show)

See Also:
Fixed In Version: RHSA-2005-395
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-10-05 08:38:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
patch to make the network counters wrap (2.36 KB, patch)
2005-04-11 17:29 EDT, Guy Streeter
no flags Details | Diff

  None (edit)
Description Guy Streeter 2005-04-11 17:28:28 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050323 Firefox/1.0.2 Fedora/1.0.2-1.3.1

Description of problem:
On systems running a 64bit kernel, the values in /proc/net/dev can get too large to fit in a 32bit object. Since they are counters they should wrap, but instead they stick the the maximum value.
This is because sscanf returns the maximum value when the scanned value doesn't fit in the size specified by the format conversion.

A solution is to use unsigned long longs for scanning, and cast them to unsigned longs afterward. This process will cause them values to wrap as expected.


Version-Release number of selected component (if applicable):
net-snmp-5.1.2-11

How reproducible:
Always

Steps to Reproduce:
1. Look at ifOutOctets on a 64bit system that has been up long enough for the value to wrap.
2.
3.
  

Actual Results:  The value sticks at 4294967295

Expected Results:  The value should wrap

Additional info:

I will attach a patch I have tested.
Comment 1 Guy Streeter 2005-04-11 17:29:59 EDT
Created attachment 112996 [details]
patch to make the network counters wrap
Comment 2 Radek Vokal 2005-04-20 04:09:49 EDT
Thanks, checked into next net-snmp update
Comment 5 dff 2005-06-22 09:54:04 EDT
PM ACK for U2; 3 ACKS so move to CanFix.
Comment 6 Red Hat Bugzilla 2005-09-28 10:26:20 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-373.html
Comment 7 Red Hat Bugzilla 2005-10-05 08:38:49 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-395.html

Note You need to log in before you can comment on or make changes to this bug.