git: d300875d011c - stable/14 - sctp: fix mapping of interface address flags
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 21 May 2025 17:08:23 UTC
The branch stable/14 has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=d300875d011c056f10dd7ef6915d041c7b559fff
commit d300875d011c056f10dd7ef6915d041c7b559fff
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2025-05-04 19:05:48 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2025-05-21 17:07:57 +0000
sctp: fix mapping of interface address flags
Do not clear the SCTP_ADDR_IFA_UNUSEABLE flag, if it was set due
to the address being deprecated. Also don't declare tentative
addresses as unusable.
While there, cleanup the code.
PR: 230242
(cherry picked from commit 9639de2a6f7eec8b2158782fbfab3419d507fdc5)
---
sys/netinet/sctp_bsd_addr.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/sys/netinet/sctp_bsd_addr.c b/sys/netinet/sctp_bsd_addr.c
index a10fbcc5ca40..65b271afd84d 100644
--- a/sys/netinet/sctp_bsd_addr.c
+++ b/sys/netinet/sctp_bsd_addr.c
@@ -119,23 +119,21 @@ sctp_gather_internal_ifa_flags(struct sctp_ifa *ifa)
ifa6 = (struct in6_ifaddr *)ifa->ifa;
ifa->flags = ifa6->ia6_flags;
- if (!MODULE_GLOBAL(ip6_use_deprecated)) {
- if (ifa->flags &
- IN6_IFF_DEPRECATED) {
+ if (MODULE_GLOBAL(ip6_use_deprecated)) {
+ ifa->localifa_flags &= ~SCTP_ADDR_IFA_UNUSEABLE;
+ } else {
+ if (ifa->flags & IN6_IFF_DEPRECATED) {
ifa->localifa_flags |= SCTP_ADDR_IFA_UNUSEABLE;
} else {
ifa->localifa_flags &= ~SCTP_ADDR_IFA_UNUSEABLE;
}
- } else {
- ifa->localifa_flags &= ~SCTP_ADDR_IFA_UNUSEABLE;
}
- if (ifa->flags &
- (IN6_IFF_DETACHED |
- IN6_IFF_ANYCAST |
- IN6_IFF_NOTREADY)) {
+ if (ifa->flags & (IN6_IFF_DETACHED | IN6_IFF_DUPLICATED)) {
+ ifa->localifa_flags |= SCTP_ADDR_IFA_UNUSEABLE;
+ }
+ /* Right now, do not support IPv6 anycast addresses */
+ if (ifa->flags & IN6_IFF_ANYCAST) {
ifa->localifa_flags |= SCTP_ADDR_IFA_UNUSEABLE;
- } else {
- ifa->localifa_flags &= ~SCTP_ADDR_IFA_UNUSEABLE;
}
}
#endif /* INET6 */