Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 12852

Summary: ifconfig reports wrong packet statistics when they're greater than LONG_MAX
Product: [Retired] Red Hat Linux Reporter: Tomasz Beger <tbeger>
Component: net-toolsAssignee: Crutcher Dunnavant <crutcher>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: pekkas
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-15 20:24:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tomasz Beger 2000-06-23 12:38:22 UTC
When an interface statistic counter is greater than 2147483647 ifconfig 
always reports the value of 2147483647 (LONG_MAX on i386). The reason of 
this behavior is that the internal representation device statistic counter 
in Linux device structure is an unsigned long and the ifconfig utility 
reads the interface statistic counters from /proc/net/dev file system as a 
string and then converts the textual representation into a long. The 
conversion is done in function if_getstats()(ifconfig.c) by a call to 
sscanf() function but with wrong conversion specification. The sscanf() 
function is told to treat the string as a signed long (%ld) and it returns 
the 2147483647 value for all strings that represent numbers exceeding the 
range of long.

Comment 1 Pekka Savola 2001-02-15 20:24:40 UTC
This has been fixed in upstream net-tools-1.58.

Comment 2 Crutcher Dunnavant 2001-04-19 18:39:01 UTC
iterating