Page MenuHomeFreeBSD

D52986.id163790.diff
No OneTemporary

D52986.id163790.diff

diff --git a/usr.bin/sockstat/main.c b/usr.bin/sockstat/main.c
--- a/usr.bin/sockstat/main.c
+++ b/usr.bin/sockstat/main.c
@@ -103,6 +103,7 @@
static u_int opt_v; /* Verbose mode */
static bool opt_w; /* Automatically size the columns */
static bool is_xo_style_encoding;
+static bool show_path_state = false;
/*
* Default protocols to use if no -P was defined.
@@ -584,6 +585,7 @@
!(local_all_loopback ||
foreign_all_loopback))) {
RB_INSERT(socks_t, &socks, sock);
+ show_path_state = true;
} else {
free_socket(sock);
}
@@ -1485,7 +1487,7 @@
} else if (!is_xo_style_encoding)
xo_emit(" {:encaps/%*s}", cw->encaps, "??");
}
- if (opt_s) {
+ if (opt_s && show_path_state) {
if (faddr != NULL &&
s->proto == IPPROTO_SCTP &&
s->state != SCTP_CLOSED &&
@@ -1620,7 +1622,9 @@
if (opt_U)
xo_emit(" {T:/%*s}", cw.encaps, "ENCAPS");
if (opt_s) {
- xo_emit(" {T:/%-*s}", cw.path_state, "PATH STATE");
+ if (show_path_state)
+ xo_emit(" {T:/%-*s}", cw.path_state,
+ "PATH STATE");
xo_emit(" {T:/%-*s}", cw.conn_state, "CONN STATE");
}
if (opt_b)
diff --git a/usr.bin/sockstat/sockstat.1 b/usr.bin/sockstat/sockstat.1
--- 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 7, 2025
+.Dd October 9, 2025
.Dt SOCKSTAT 1
.Os
.Sh NAME
@@ -205,6 +205,7 @@
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.
.It Li CONN STATE
The connection state if
.Fl s

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 1, 3:05 PM (19 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29103181
Default Alt Text
D52986.id163790.diff (1 KB)

Event Timeline