Ensure that the -a, -W, -L options for SCTP behave similar

as for TCP.

MFC after:	3 days
This commit is contained in:
tuexen 2016-07-15 23:13:57 +00:00
parent 6a5377a237
commit 3ffa3182a7

View File

@ -447,7 +447,8 @@ sctp_process_inpcb(struct xsctp_inpcb *xinpcb,
first = 0; first = 0;
} }
xladdr = (struct xsctp_laddr *)(buf + *offset); xladdr = (struct xsctp_laddr *)(buf + *offset);
if (Lflag && !is_listening) { if ((!aflag && is_listening) ||
(Lflag && !is_listening)) {
sctp_skip_xinpcb_ifneed(buf, buflen, offset); sctp_skip_xinpcb_ifneed(buf, buflen, offset);
return; return;
} }
@ -513,8 +514,10 @@ sctp_process_inpcb(struct xsctp_inpcb *xinpcb,
xo_open_instance("local-address"); xo_open_instance("local-address");
if (xladdr_total == 0) { if (xladdr_total == 0) {
xo_emit("{:protocol/%-6.6s/%s} {:type/%-5.5s/%s} ", if (!Lflag) {
pname, tname); xo_emit("{:protocol/%-6.6s/%s} "
"{:type/%-5.5s/%s} ", pname, tname);
}
} else { } else {
xo_emit("\n"); xo_emit("\n");
xo_emit(Lflag ? "{P:/%-21.21s} " : "{P:/%-12.12s} ", xo_emit(Lflag ? "{P:/%-21.21s} " : "{P:/%-12.12s} ",