sctp: don't report unusable addresses via sysctl interface

When reporting the local addresses of an endpoint (inp without
stcb), ignore unusable addresses.

MFC after:	3 days
This commit is contained in:
Michael Tuexen 2025-05-05 00:28:52 +02:00
parent 79952cd764
commit 8f5f6680ef

View file

@ -265,6 +265,10 @@ sctp_sysctl_copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *st
if (sctp_is_addr_restricted(stcb, sctp_ifa)) {
continue;
}
} else {
if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) {
continue;
}
}
switch (sctp_ifa->address.sa.sa_family) {
#ifdef INET