From: Jan Klemkow Subject: netstat: adjust multicast counter output To: tech@openbsd.org Date: Tue, 20 May 2025 08:51:20 +0200 Hi, In this diff, I want to adjust the output of the multicast counters. - IPv4 and IPv6 sections are explicitly named - reordered all output strings as they appear in the structs - use the same human readable descriptions for IPv4 and IPv6 ok? bye, Jan Index: mroute.c =================================================================== RCS file: /cvs/src/usr.bin/netstat/mroute.c,v diff -u -p -r1.28 mroute.c --- mroute.c 20 May 2025 00:08:28 -0000 1.28 +++ mroute.c 20 May 2025 06:39:34 -0000 @@ -161,31 +161,31 @@ mrt_stats(void) return; } - printf("multicast routing:\n"); + printf("ipv4 multicast routing:\n"); printf("\t%lu multicast forwarding cache lookup%s\n", mrtstat.mrts_mfc_lookups, plural(mrtstat.mrts_mfc_lookups)); printf("\t%lu multicast forwarding cache miss%s\n", mrtstat.mrts_mfc_misses, plurales(mrtstat.mrts_mfc_misses)); + printf("\t%lu upcall%s to mrouted\n", + mrtstat.mrts_upcalls, plural(mrtstat.mrts_upcalls)); printf("\t%lu datagram%s with no route for origin\n", mrtstat.mrts_no_route, plural(mrtstat.mrts_no_route)); - printf("\t%lu upcall%s made to mrouted\n", - mrtstat.mrts_upcalls, plural(mrtstat.mrts_upcalls)); printf("\t%lu datagram%s with malformed tunnel options\n", mrtstat.mrts_bad_tunnel, plural(mrtstat.mrts_bad_tunnel)); - printf("\t%lu datagram%s with no room for tunnel options\n", + printf("\t%lu datagram%s could not be tunneled\n", mrtstat.mrts_cant_tunnel, plural(mrtstat.mrts_cant_tunnel)); printf("\t%lu datagram%s arrived on wrong interface\n", mrtstat.mrts_wrong_if, plural(mrtstat.mrts_wrong_if)); - printf("\t%lu datagram%s dropped due to upcall Q overflow\n", + printf("\t%lu datagram%s dropped due to upcall queue overflow\n", mrtstat.mrts_upq_ovflw, plural(mrtstat.mrts_upq_ovflw)); - printf("\t%lu datagram%s dropped due to upcall socket overflow\n", - mrtstat.mrts_upq_sockfull, plural(mrtstat.mrts_upq_sockfull)); printf("\t%lu datagram%s cleaned up by the cache\n", mrtstat.mrts_cache_cleanups, plural(mrtstat.mrts_cache_cleanups)); printf("\t%lu datagram%s dropped selectively by ratelimiter\n", mrtstat.mrts_drop_sel, plural(mrtstat.mrts_drop_sel)); - printf("\t%lu datagram%s dropped - bucket Q overflow\n", + printf("\t%lu datagram%s dropped due to queue overflow\n", mrtstat.mrts_q_overflow, plural(mrtstat.mrts_q_overflow)); - printf("\t%lu datagram%s dropped - larger than bkt size\n", + printf("\t%lu datagram%s dropped for being too large\n", mrtstat.mrts_pkt2large, plural(mrtstat.mrts_pkt2large)); + printf("\t%lu datagram%s dropped due to full socket buffer\n", + mrtstat.mrts_upq_sockfull, plural(mrtstat.mrts_upq_sockfull)); } Index: mroute6.c =================================================================== RCS file: /cvs/src/usr.bin/netstat/mroute6.c,v diff -u -p -r1.26 mroute6.c --- mroute6.c 20 May 2025 00:08:28 -0000 1.26 +++ mroute6.c 20 May 2025 06:33:58 -0000 @@ -194,31 +194,31 @@ mrt6_stats(void) return; } - printf("multicast forwarding:\n"); + printf("ipv6 multicast routing:\n"); printf("\t%llu multicast forwarding cache lookup%s\n", mrt6stat.mrt6s_mfc_lookups, plural(mrt6stat.mrt6s_mfc_lookups)); printf("\t%llu multicast forwarding cache miss%s\n", mrt6stat.mrt6s_mfc_misses, plurales(mrt6stat.mrt6s_mfc_misses)); printf("\t%llu upcall%s to mrouted\n", mrt6stat.mrt6s_upcalls, plural(mrt6stat.mrt6s_upcalls)); - printf("\t%llu upcall queue overflow%s\n", - mrt6stat.mrt6s_upq_ovflw, plural(mrt6stat.mrt6s_upq_ovflw)); - printf("\t%llu upcall%s dropped due to full socket buffer\n", - mrt6stat.mrt6s_upq_sockfull, plural(mrt6stat.mrt6s_upq_sockfull)); - printf("\t%llu cache cleanup%s\n", - mrt6stat.mrt6s_cache_cleanups, plural(mrt6stat.mrt6s_cache_cleanups)); printf("\t%llu datagram%s with no route for origin\n", mrt6stat.mrt6s_no_route, plural(mrt6stat.mrt6s_no_route)); - printf("\t%llu datagram%s arrived with bad tunneling\n", + printf("\t%llu datagram%s with malformed tunnel options\n", mrt6stat.mrt6s_bad_tunnel, plural(mrt6stat.mrt6s_bad_tunnel)); printf("\t%llu datagram%s could not be tunneled\n", mrt6stat.mrt6s_cant_tunnel, plural(mrt6stat.mrt6s_cant_tunnel)); printf("\t%llu datagram%s arrived on wrong interface\n", mrt6stat.mrt6s_wrong_if, plural(mrt6stat.mrt6s_wrong_if)); - printf("\t%llu datagram%s selectively dropped\n", + printf("\t%llu datagram%s dropped due to upcall queue overflow\n", + mrt6stat.mrt6s_upq_ovflw, plural(mrt6stat.mrt6s_upq_ovflw)); + printf("\t%llu datagram%s cleaned up by the cache\n", + mrt6stat.mrt6s_cache_cleanups, plural(mrt6stat.mrt6s_cache_cleanups)); + printf("\t%llu datagram%s dropped selectively by ratelimiter\n", mrt6stat.mrt6s_drop_sel, plural(mrt6stat.mrt6s_drop_sel)); printf("\t%llu datagram%s dropped due to queue overflow\n", mrt6stat.mrt6s_q_overflow, plural(mrt6stat.mrt6s_q_overflow)); printf("\t%llu datagram%s dropped for being too large\n", mrt6stat.mrt6s_pkt2large, plural(mrt6stat.mrt6s_pkt2large)); + printf("\t%llu datagram%s dropped due to full socket buffer\n", + mrt6stat.mrt6s_upq_sockfull, plural(mrt6stat.mrt6s_upq_sockfull)); }