summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorsumikawa <sumikawa@FreeBSD.org>2001-06-21 08:27:09 +0000
committersumikawa <sumikawa@FreeBSD.org>2001-06-21 08:27:09 +0000
commiteaafbef7b8981b37477c444f9653513886a2e97b (patch)
tree75545602d7cadec898fc55d247aa43be8551a981 /usr.bin/netstat
parent845436d272c9c49c06426425ff3b6349fb1f7a0b (diff)
downloadFreeBSD-src-eaafbef7b8981b37477c444f9653513886a2e97b.zip
FreeBSD-src-eaafbef7b8981b37477c444f9653513886a2e97b.tar.gz
- Avoid hardcoded constant on icmp6 in/out histogram printing
- Icmp6 histogram update for inverse neighbor solicit/advert. Obtained from: KAME MFC after: 2 weeks
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/inet6.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c
index c89c09f..7d432d5 100644
--- a/usr.bin/netstat/inet6.c
+++ b/usr.bin/netstat/inet6.c
@@ -686,8 +686,8 @@ static char *icmp6names[] = {
"router renumbering",
"node information request",
"node information reply",
- "#141",
- "#142",
+ "inverse neighbor solicitation",
+ "inverse neighbor advertisement",
"#143",
"#144",
"#145",
@@ -826,7 +826,8 @@ icmp6_stats(u_long off __unused, char *name, int af __unused)
"\t%llu error%s not generated because old message was icmp error or so\n");
p(icp6s_toofreq,
"\t%llu error%s not generated because rate limitation\n");
- for (first = 1, i = 0; i < 256; i++)
+#define NELEM (sizeof(icmp6stat.icp6s_outhist)/sizeof(icmp6stat.icp6s_outhist[0]))
+ for (first = 1, i = 0; i < NELEM; i++)
if (icmp6stat.icp6s_outhist[i] != 0) {
if (first) {
printf("\tOutput histogram:\n");
@@ -835,11 +836,13 @@ icmp6_stats(u_long off __unused, char *name, int af __unused)
printf("\t\t%s: %llu\n", icmp6names[i],
(unsigned long long)icmp6stat.icp6s_outhist[i]);
}
+#undef NELEM
p(icp6s_badcode, "\t%llu message%s with bad code fields\n");
p(icp6s_tooshort, "\t%llu message%s < minimum length\n");
p(icp6s_checksum, "\t%llu bad checksum%s\n");
p(icp6s_badlen, "\t%llu message%s with bad length\n");
- for (first = 1, i = 0; i < ICMP6_MAXTYPE; i++)
+#define NELEM (sizeof(icmp6stat.icp6s_inhist)/sizeof(icmp6stat.icp6s_inhist[0]))
+ for (first = 1, i = 0; i < NELEM; i++)
if (icmp6stat.icp6s_inhist[i] != 0) {
if (first) {
printf("\tInput histogram:\n");
@@ -848,6 +851,7 @@ icmp6_stats(u_long off __unused, char *name, int af __unused)
printf("\t\t%s: %llu\n", icmp6names[i],
(unsigned long long)icmp6stat.icp6s_inhist[i]);
}
+#undef NELEM
printf("\tHistogram of error messages to be generated:\n");
p_5(icp6s_odst_unreach_noroute, "\t\t%llu no route\n");
p_5(icp6s_odst_unreach_admin, "\t\t%llu administratively prohibited\n");
OpenPOWER on IntegriCloud