Index: sys/netinet/tcp_subr.c =================================================================== --- sys/netinet/tcp_subr.c +++ sys/netinet/tcp_subr.c @@ -1356,6 +1356,10 @@ xt.xt_socket.xso_protocol = IPPROTO_TCP; } xt.xt_inp.inp_gencnt = inp->inp_gencnt; + xt.xt_cc_name[0] = '\0'; + if (CC_ALGO(&xt.xt_tp) != NULL) + strlcpy(xt.xt_cc_name, CC_ALGO(&xt.xt_tp)->name, + sizeof(xt.xt_cc_name)); INP_RUNLOCK(inp); error = SYSCTL_OUT(req, &xt, sizeof xt); } else Index: sys/netinet/tcp_var.h =================================================================== --- sys/netinet/tcp_var.h +++ sys/netinet/tcp_var.h @@ -590,6 +590,7 @@ struct xsocket xt_socket; struct xtcp_timer xt_timer; u_quad_t xt_alignment_hack; + char xt_cc_name[TCP_CA_NAME_MAX]; }; #endif Index: usr.bin/netstat/inet.c =================================================================== --- usr.bin/netstat/inet.c +++ usr.bin/netstat/inet.c @@ -307,6 +307,7 @@ static int first = 1; char *buf; const char *vchar; + char *algo; struct tcpcb *tp = NULL; struct inpcb *inp; struct xinpgen *xig, *oxig; @@ -357,10 +358,12 @@ tp = &((struct xtcpcb *)xig)->xt_tp; inp = &((struct xtcpcb *)xig)->xt_inp; so = &((struct xtcpcb *)xig)->xt_socket; + algo = ((struct xtcpcb *)xig)->xt_cc_name; } else { inp = &((struct xinpcb *)xig)->xi_inp; so = &((struct xinpcb *)xig)->xi_socket; timer = NULL; + algo = NULL; } /* Ignore sockets for protocols other than the desired one. */ @@ -421,10 +424,10 @@ "Proto", "Listen", "Local Address"); else if (Tflag) xo_emit((Aflag && !Wflag) ? - "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-18.18s} {T:/%s}" : - "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-22.22s} {T:/%s}", - "Proto", "Rexmit", "OOORcv", "0-win", - "Local Address", "Foreign Address"); + "{T:/%-5.5s} {T:/%-8.8s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-18.18s} {T:/%s}" : + "{T:/%-5.5s} {T:/%-8.8s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-22.22s} {T:/%s}", + "Proto", "CC Alg", "Rexmit", "OOORcv", "0-win", + "Local Address", "Foreign Address"); else { xo_emit((Aflag && !Wflag) ? "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-18.18s} {T:/%-18.18s}" : @@ -478,6 +481,8 @@ xo_emit("{:protocol/%-3.3s%-2.2s/%s%s} ", "toe", vchar); else xo_emit("{:protocol/%-3.3s%-2.2s/%s%s} ", name, vchar); + if (istcp && Tflag) + xo_emit("{:cc/%-8.8s} ", algo); if (Lflag) { char buf1[15];