RE: [PATCH] /proc/net/dev counter fix, linux-2.5.0

From: BALBIR SINGH (balbir.singh@wipro.com)
Date: Wed Dec 12 2001 - 06:25:42 EST


--- linux-2.5.0or/include/linux/netdevice.h Thu Nov 22 21:47:09 2001
+++ linux/include/linux/netdevice.h Tue Dec 11 21:24:54 2001
@@ -97,8 +97,9 @@
 {
         unsigned long rx_packets; /* total packets received */
         unsigned long tx_packets; /* total packets transmitted */
- unsigned long rx_bytes; /* total bytes received */
- unsigned long tx_bytes; /* total bytes transmitted */
+ /* rx and tx counters fixed up to 64-bit */
+ long long rx_bytes; /* total bytes received
*/
+ long long tx_bytes; /* total bytes transmitted
*/

It is better to define these as unsigned long long, you are anyway
printing them as unsigned long long. Its about time this was fixed,
I have Gigabit cards and it is very easy to produce an overflow.
I think the MAINTAINER for ifconfig(8) should be made aware of these
changes as well.

Balbir



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Dec 15 2001 - 21:00:23 EST