git: 19bb9fecba8e - stable/14 - systat: improve reporting of UDP statistics

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Fri, 05 Sep 2025 19:04:50 UTC
The branch stable/14 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=19bb9fecba8ea76bf320b6732c3900c554b4a347

commit 19bb9fecba8ea76bf320b6732c3900c554b4a347
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2025-08-13 18:21:34 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2025-09-05 19:04:02 +0000

    systat: improve reporting of UDP statistics
    
    Report the undelivered multi and broadcast UDP packets separately.
    
    Reviewed by:            rrs, cc
    Sponsored by:           Netflix, Inc.
    Differential Revision:  https://reviews.freebsd.org/D51884
    
    (cherry picked from commit b9de52a0ec07088006dc373c2d882f410aa51f1e)
---
 usr.bin/systat/ip.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/usr.bin/systat/ip.c b/usr.bin/systat/ip.c
index bc90ff557e20..67019f78bc45 100644
--- a/usr.bin/systat/ip.c
+++ b/usr.bin/systat/ip.c
@@ -85,9 +85,10 @@ static struct stat curstat, initstat, oldstat;
 13999999999 packets forwarded        999999999 - no checksum
 14999999999 - unreachable dests      999999999 - invalid length
 15999999999 - redirects generated    999999999 - no socket for dest port
-16999999999 option errors            999999999 - no socket for broadcast
-17999999999 unwanted multicasts      999999999 - socket buffer full
-18999999999 delivered to upper layer 999999999 total output packets
+16999999999 option errors            999999999   - no socket for broadcast
+17999999999 unwanted multicasts      999999999   - no socket for multicast
+18999999999 delivered to upper layer 999999999 - socket buffer full
+19999999999                          999999999 total output packets
 --0123456789012345678901234567890123456789012345678901234567890123456789012345
 --0         1         2         3         4         5         6         7
 */
@@ -130,9 +131,10 @@ labelip(void)
 	L(13, "packets forwarded");	R(13, "- no checksum");
 	L(14, "- unreachable dests");	R(14, "- invalid length");
 	L(15, "- redirects generated");	R(15, "- no socket for dest port");
-	L(16, "option errors");		R(16, "- no socket for broadcast");
-	L(17, "unwanted multicasts");	R(17, "- socket buffer full");
-	L(18, "delivered to upper layer");	R(18, "total output packets");
+	L(16, "option errors");		R(16, "  - no socket for broadcast");
+	L(17, "unwanted multicasts");	R(17, "  - no socket for multicast");
+	L(18, "delivered to upper layer");	R(18, "- socket buffer full");
+					R(19, "total output packets");
 #undef L
 #undef R
 }
@@ -192,6 +194,7 @@ domode(struct stat *ret)
 	DO(u.udps_badlen);
 	DO(u.udps_noport);
 	DO(u.udps_noportbcast);
+	DO(u.udps_noportmcast);
 	DO(u.udps_fullsock);
 	DO(u.udps_opackets);
 #undef DO
@@ -240,9 +243,10 @@ showip(void)
 	DO(i.ips_badoptions, 16, 0);
 	DO(u.udps_noportbcast, 16, 35);
 	DO(i.ips_notmember, 17, 0);
-	DO(u.udps_fullsock, 17, 35);
+	DO(u.udps_noportmcast, 17, 35);
 	DO(i.ips_delivered, 18, 0);
-	DO(u.udps_opackets, 18, 35);
+	DO(u.udps_fullsock, 18, 35);
+	DO(u.udps_opackets, 19, 35);
 #undef DO
 }