From e1f26be6d1fc41cf8ff88083844167ae92445cb0 Mon Sep 17 00:00:00 2001 From: Bram Date: Wed, 17 Jul 2024 09:48:36 +0200 Subject: [PATCH] netstat: Fix duplicate keys in libxo output Duplicate keys in libxo output have been given a unique name. PR: 244589, 254672 Pull Request: https://github.com/freebsd/freebsd-src/pull/1331 --- usr.bin/netstat/if.c | 8 ++++---- usr.bin/netstat/sctp.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index 172ea5324ccbdf..74c40ad238b50e 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -501,7 +501,7 @@ intpr(void (*pfunc)(char *), int af) IFA_STAT(ipackets), link|network, 1); show_stat("lu", nerr_len, "received-errors", IFA_STAT(ierrors), link, 1); - show_stat("lu", nerr_len, "dropped-packets", IFA_STAT(iqdrops), + show_stat("lu", nerr_len, "dropped-packets-in", IFA_STAT(iqdrops), link, 1); if (bflag) show_stat("lu", nbyte_len, "received-bytes", @@ -516,7 +516,7 @@ intpr(void (*pfunc)(char *), int af) show_stat("NRSlu", nerr_len, "collisions", IFA_STAT(collisions), link, 1); if (dflag) - show_stat("LSlu", nerr_len, "dropped-packets", + show_stat("LSlu", nerr_len, "dropped-packets-out", IFA_STAT(oqdrops), link, 1); xo_emit("\n"); @@ -705,7 +705,7 @@ sidewaysintpr(void) new->ift_ip - old->ift_ip, 1, 1); show_stat("lu", 5, "received-errors", new->ift_ie - old->ift_ie, 1, 1); - show_stat("lu", 5, "dropped-packets", + show_stat("lu", 5, "dropped-packets-in", new->ift_id - old->ift_id, 1, 1); show_stat("lu", 10, "received-bytes", new->ift_ib - old->ift_ib, 1, 0); @@ -718,7 +718,7 @@ sidewaysintpr(void) show_stat("NRSlu", 5, "collisions", new->ift_co - old->ift_co, 1, 1); if (dflag) - show_stat("LSlu", 5, "dropped-packets", + show_stat("LSlu", 5, "dropped-packets-out", new->ift_od - old->ift_od, 1, 1); xo_close_instance("stats"); xo_emit("\n"); diff --git a/usr.bin/netstat/sctp.c b/usr.bin/netstat/sctp.c index 92c4bf67b2faf5..e9fd494e292b4e 100644 --- a/usr.bin/netstat/sctp.c +++ b/usr.bin/netstat/sctp.c @@ -711,7 +711,7 @@ sctp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) "secret\n"); p(sctps_timopathmtu, "\t\t{:pmtu-timer/%ju} " "{N:/PMTU timer%s fired}\n"); - p(sctps_timoshutdownack, "\t\t{:shutdown-timer/%ju} " + p(sctps_timoshutdownack, "\t\t{:shutdown-ack-timer/%ju} " "{N:/shutdown ack timer%s fired}\n"); p(sctps_timoshutdownguard, "\t\t{:shutdown-guard-timer/%ju} " "{N:/shutdown guard timer%s fired}\n");