From nobody Fri Sep 20 15:58:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9H9G5WqFz5Xg7Q; Fri, 20 Sep 2024 15:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9H9G3F43z4drV; Fri, 20 Sep 2024 15:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726847890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YYMa/O/pwptc7DoyS/0x/Ya1S+pdFRlfc3T7Wfpb1Ow=; b=QQvDtxhHSaoTo29uVElMr4Ek7/Jp0BnnbHKmJVEybUDg61pOtoNopf3m6gAgdMAj4qvVbP JU3NSftdW8vb7gLiji2lk23ptKpT3lHtTCm3jTQT7JvkmgJdKURPbLee+a06zd82/M8RYJ ZLZz2ykjSElHY308dUqLlfHK2zds+MHcaWhvmx0yXMiuRHL0jGw/KcVOHTf5caxNFFtW+0 6Y/pvGJjDEBHoIIPiQmCbrAlqoLnTAHru28EuFzD2bZ5n6cUujcY7kKhNyWsOlHrYKQ8Mk RHfKp9t9UVYYfsVos9r6TFos79hfNeP0+uvNacRhddcB6LTwHTR2UXNPgCdxIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726847890; a=rsa-sha256; cv=none; b=dV+cZJtmwvxe8URWql9cSFryWmPbCEbANIP69f5XUfwjZ7h6NuXnNS3WINhs33zOcDORr3 78IwJWmLjYHWq8ztFn1diLiPgZ+qyVZt2ckhW2Wc8FGlzmNzrjYtkX6KretF/VqF6GM2Vy RqCFpt4B0Auu8uFtRBU09ZrpETVhmAj62v3zNS7HSDplK4y+ARliGcIEpJ9UOEtYWgWvn4 XdmnPKmxfVNRueFeNGiljyHwYhGjXs9HMMLs7BpeOmm/yXzgZrs6dJSLGg+88n1JP3k4EZ b6wNe+Bv1giWfLjTtipGYr5ycgKiCP2rOkCIEL7QdBM6lgBF1J+nBnqQfCqD/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726847890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YYMa/O/pwptc7DoyS/0x/Ya1S+pdFRlfc3T7Wfpb1Ow=; b=QqlZ4EutsupyibZ6q1gOrKTuD2gGTDiZTfz+2VHXmIRNXe8RmMoXgOYNmOVVC/AKTnz1Nf 0FPC0dvmkRwpfkhH7ENJUUzSzZbgYgY50SjQOB2ZtzSxYp/+zJXXkvtbwuFupAUMV9RvDy iiB5A3/i7wz8mTu4awxpf/BhbvDBlXdIwfYt8ygjwlR175Pn2hBXGaMKdFrnl3fc5OE0tN GN9kkinLoEYlAGrLDxHdXVQl+qe1LWiJGn6JFsa3D2VCcIY9QTQiq/+dfERzy7zf0bl+1V jvszhthHqoxWJRM26I6856ublYqeFzXwU4cYeNdDcWfjBKCb9ROcd8+VjFrcMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X9H9G2JdDzvwv; Fri, 20 Sep 2024 15:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48KFwAog048838; Fri, 20 Sep 2024 15:58:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KFwAEN048834; Fri, 20 Sep 2024 15:58:10 GMT (envelope-from git) Date: Fri, 20 Sep 2024 15:58:10 GMT Message-Id: <202409201558.48KFwAEN048834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 94567c8641e2 - main - netstat: Resolve duplicate "dropped-packets" key from libxo output List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94567c8641e235763b5b2926416d89d36654cde1 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=94567c8641e235763b5b2926416d89d36654cde1 commit 94567c8641e235763b5b2926416d89d36654cde1 Author: Bram AuthorDate: 2024-07-23 08:57:42 +0000 Commit: Warner Losh CommitDate: 2024-09-20 15:06:26 +0000 netstat: Resolve duplicate "dropped-packets" key from libxo output The current libxo output uses the "dropped-packets" key for both incoming and outgoing packets. This commit distinguishes between the two by adding an "in" and "out" suffix. The original "dropped-packets" key is kept for backwards compatibility for now. PR: 244589 Reviewed by: imp, zlei Pull Request: https://github.com/freebsd/freebsd-src/pull/1331 --- usr.bin/netstat/if.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index 172ea5324ccb..f0af785bce04 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -501,8 +501,11 @@ intpr(void (*pfunc)(char *), int af) IFA_STAT(ipackets), link|network, 1); show_stat("lu", nerr_len, "received-errors", IFA_STAT(ierrors), link, 1); + /* Below is kept for backwards compatibility. Will be removed in the future. */ show_stat("lu", nerr_len, "dropped-packets", IFA_STAT(iqdrops), link, 1); + show_stat("lu", nerr_len, "dropped-packets-in", IFA_STAT(iqdrops), + link, 1); if (bflag) show_stat("lu", nbyte_len, "received-bytes", IFA_STAT(ibytes), link|network, 0); @@ -516,7 +519,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,8 +708,11 @@ loop: new->ift_ip - old->ift_ip, 1, 1); show_stat("lu", 5, "received-errors", new->ift_ie - old->ift_ie, 1, 1); + /* Below is kept for backwards compatibility. Will be removed in the future. */ show_stat("lu", 5, "dropped-packets", new->ift_id - old->ift_id, 1, 1); + 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); show_stat("lu", 10, "sent-packets", @@ -718,7 +724,7 @@ loop: 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");