svn commit: r302917 - head/usr.bin/netstat

Michael Tuexen tuexen at FreeBSD.org
Fri Jul 15 23:13:58 UTC 2016


Author: tuexen
Date: Fri Jul 15 23:13:57 2016
New Revision: 302917
URL: https://svnweb.freebsd.org/changeset/base/302917

Log:
  Ensure that the -a, -W, -L options for SCTP behave similar
  as for TCP.
  
  MFC after:	3 days

Modified:
  head/usr.bin/netstat/sctp.c

Modified: head/usr.bin/netstat/sctp.c
==============================================================================
--- head/usr.bin/netstat/sctp.c	Fri Jul 15 23:03:20 2016	(r302916)
+++ head/usr.bin/netstat/sctp.c	Fri Jul 15 23:13:57 2016	(r302917)
@@ -447,7 +447,8 @@ sctp_process_inpcb(struct xsctp_inpcb *x
 		first = 0;
 	}
 	xladdr = (struct xsctp_laddr *)(buf + *offset);
-	if (Lflag && !is_listening) {
+	if ((!aflag && is_listening) ||
+	    (Lflag && !is_listening)) {
 		sctp_skip_xinpcb_ifneed(buf, buflen, offset);
 		return;
 	}
@@ -513,8 +514,10 @@ retry:
 		xo_open_instance("local-address");
 
 		if (xladdr_total == 0) {
-			xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ",
-			    pname, tname);
+			if (!Lflag) {
+				xo_emit("{:protocol/%-6.6s/%s} "
+				    "{:type/%-5.5s/%s} ", pname, tname);
+			}
 		} else {
 			xo_emit("\n");
 			xo_emit(Lflag ? "{P:/%-21.21s} " : "{P:/%-12.12s} ",


More information about the svn-src-all mailing list