From: Erik Schoenfelder <schoenfr@gaertner.de>
To: linux-kernel@vger.kernel.org
Cc: Marcelo Tosatti <marcelo@conectiva.com.br>
Subject: [2.4.19] small bug plus fix for /proc/net/snmp (Imcp: field count)
Date: Sun, 29 Sep 2002 21:55:42 +0200 (MEST) [thread overview]
Message-ID: <200209291955.g8TJtgp24880@aunt2.gaertner.de> (raw)
Hi,
i received a bug report plus fix from Gonzalo A. Arana Tagle
<garana@uolsinectis.com.ar> about a extra dummy value printed for the
``Icmp:'' values in /proc/net/snmp:
# awk '/Icmp/ { print NF; }' /proc/net/snmp
27
28
the code in snmp_get_info() from net/ipv4/proc.c prints a dummy value
present at the end of struct icmp_mib, which should not be included.
from include/net/snmp.h:
> struct icmp_mib
> {
> unsigned long IcmpInMsgs;
> [...]
> unsigned long IcmpOutAddrMaskReps;
> unsigned long dummy;
> unsigned long __pad[0];
> } ____cacheline_aligned;
instead of printing all values before the __pad field, printing the
values before the dummy field gives the right number of values:
--- linux-2.4.19/net/ipv4/proc.c-dist Wed May 16 19:21:45 2001
+++ linux-2.4.19/net/ipv4/proc.c Sat Sep 28 22:03:05 2002
@@ -128,7 +128,7 @@
len += sprintf (buffer + len,
"\nIcmp: InMsgs InErrors InDestUnreachs InTimeExcds InParmProbs InSrcQuenchs InRedirects InEchos InEchoReps InTimestamps InTimestampReps InAddrMasks InAddrMaskReps OutMsgs OutErrors OutDestUnreachs OutTimeExcds OutParmProbs OutSrcQuenchs OutRedirects OutEchos OutEchoReps OutTimestamps OutTimestampReps OutAddrMasks OutAddrMaskReps\n"
"Icmp:");
- for (i=0; i<offsetof(struct icmp_mib, __pad)/sizeof(unsigned long); i++)
+ for (i=0; i<offsetof(struct icmp_mib, dummy)/sizeof(unsigned long); i++)
len += sprintf(buffer+len, " %lu", fold_field((unsigned long*)icmp_statistics, sizeof(struct icmp_mib), i));
len += sprintf (buffer + len,
please fix this. thank's in advance,
Erik
next reply other threads:[~2002-09-29 19:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-29 19:55 Erik Schoenfelder [this message]
2002-09-30 0:54 ` David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200209291955.g8TJtgp24880@aunt2.gaertner.de \
--to=schoenfr@gaertner.de \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®