From 8f5f6680efa28135bf37f3def2aa71f35bd30333 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Mon, 5 May 2025 00:28:52 +0200 Subject: [PATCH] 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 --- sys/netinet/sctp_sysctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index a39429ec046..bd2f23f4072 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -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