From nobody Fri Oct 17 05:47:37 2025 X-Original-To: dev-commits-src-all@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 4cnv3s3rsQz6CfyQ; Fri, 17 Oct 2025 05:47:37 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cnv3s1X3Pz3SkY; Fri, 17 Oct 2025 05:47:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760680057; 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=dT8CADMyLa9uZZPaTHyhSp7Up+az5L7bNBhvFCY3O+I=; b=MPc3Kx1YOB9pgs/OZ2KiSDrAQo5p7k4NFihWQ8L7EiMon80GARyQsDYqwtaXABAIBmidOh zJ3JDUubG9WUHJX+URk1irfudDlCGX99SViCzWv2kUFmwyUngn8VcnSAFVeL/pW2z1Kqut wVdiz79tOwetvLgC1KxibP1kBmEfi9KOFJWrf+UTygGEdjb3m43fTOUiGo8bDo79CZSzhS YBtRzOv9LGYJt/ejlmEwLWcAFqiynd+QK5Qk1+cqKcpJ15GUDAegzyTxjxKWJjw7YjxSHQ 9U9geiH2Bw4M8I2Wab5kpCHhhLTMuLpwTkXTUi0cw0ZMcW5liZ7HRg1YcMqczQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760680057; 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=dT8CADMyLa9uZZPaTHyhSp7Up+az5L7bNBhvFCY3O+I=; b=oTR0LLnSWXmgaa5NCBtQWyCwPwyM5xWupUM1et2ttp8OuXdEmHejiHp4waIeWxLk62avQu rMo52iKuePofBjzNGwHd0ZEPKQYWrXGaz66pXKtXFKUQumf/Smy+utRlxonaMZep/mWx/1 U7JeNn9cWlyLvXlOVY3Em5wozRkNInjfF8l4wW8qySW4yNoGrdmstmaeQhwCJFosc74TBR iIw/U3FEIq45PpsZXa9xBz7aW+sD+c0dc0xFp3uaZgk26G7UBvA69Zdbk/3W2RmZFClkvh Mc/jGO+XDT68GoG3sF8dMJ16Rv0UlRzSbfp+qMvMIoCOLFP5RmatldFjEVgobg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760680057; a=rsa-sha256; cv=none; b=P4wdKlUh599sVDdD5oGYp8atMBA1Js/Ydv+MpOxPVHL2k/8r3g6p9xVYyaKHy79tF6szke 7ouGRDYDdULYCu99I8EFGLbqjPCT+xcBloYI4vqXg1T+smL4y5x3c2mVIxhB19qB5lEOAF QqyRp1tNNetDKc913PomlA39/bw7yYdSra0WkeyRpPx3/QFu0cMYYmWm+35xDw7CuJv2xW 0HupsztgxBYIJB6XAk3DpkCbZPzsXp5/klxGnelGiFPMQRxGYjOSCIlRxhpWip3IRfu/4e 3Kwn2OGVn98T1YwjzgcGaLJPzIAbIRRB0gpvU4xj866vM3llFImX/bY3lhvmLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cnv3s17RDzjGq; Fri, 17 Oct 2025 05:47:37 +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 59H5lbJI010313; Fri, 17 Oct 2025 05:47:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59H5lb6n010310; Fri, 17 Oct 2025 05:47:37 GMT (envelope-from git) Date: Fri, 17 Oct 2025 05:47:37 GMT Message-Id: <202510170547.59H5lb6n010310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: f6923c0a68a6 - stable/15 - sockstat: improve handling of path state List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f6923c0a68a67d69762e188273f0e87f231ec964 Auto-Submitted: auto-generated The branch stable/15 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f6923c0a68a67d69762e188273f0e87f231ec964 commit f6923c0a68a67d69762e188273f0e87f231ec964 Author: Michael Tuexen AuthorDate: 2025-10-14 06:39:37 +0000 Commit: Michael Tuexen CommitDate: 2025-10-17 05:46:53 +0000 sockstat: improve handling of path state Only suppress the path state column when producing traditional text output. When generating html output, always include the column. Please note that when generating json or xml output, optional fields like the path state are only generated if they is applicable. This has not been changed. The changes in this patch were suggested by asomers. Reviewed by: asomers Fixes: 746eadecaa7d ("sockstat: show path state column only when useful") Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D53005 (cherry picked from commit 97e858f5b335ae8f98619f9cee8ab9a0501cd06d) --- usr.bin/sockstat/main.c | 8 +++++--- usr.bin/sockstat/sockstat.1 | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/usr.bin/sockstat/main.c b/usr.bin/sockstat/main.c index 7fedfd5b8724..d1ea6b1bc958 100644 --- a/usr.bin/sockstat/main.c +++ b/usr.bin/sockstat/main.c @@ -1789,9 +1789,11 @@ main(int argc, char *argv[]) argc = xo_parse_args(argc, argv); if (argc < 0) exit(1); - if (xo_get_style(NULL) != XO_STYLE_TEXT && - xo_get_style(NULL) != XO_STYLE_HTML) - is_xo_style_encoding = true; + if (xo_get_style(NULL) != XO_STYLE_TEXT) { + show_path_state = true; + if (xo_get_style(NULL) != XO_STYLE_HTML) + is_xo_style_encoding = true; + } opt_j = -1; while ((o = getopt(argc, argv, "46AbCcfIij:Llnp:P:qSsUuvw")) != -1) switch (o) { diff --git a/usr.bin/sockstat/sockstat.1 b/usr.bin/sockstat/sockstat.1 index d14eb967ad0f..1498fb1d88f7 100644 --- a/usr.bin/sockstat/sockstat.1 +++ b/usr.bin/sockstat/sockstat.1 @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 9, 2025 +.Dd October 14, 2025 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -205,7 +205,8 @@ is specified (only for SCTP or TCP). The path state if .Fl s is specified (only for SCTP). -This column is only shown when there is at least one path state shown. +When using traditional text output, this column is only shown when there is at +least one path state to show. .It Li CONN STATE The connection state if .Fl s