Skip to content

Commit 9639de2

Browse files
committed
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 MFC after: 3 days
1 parent ec5083a commit 9639de2

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

sys/netinet/sctp_bsd_addr.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,21 @@ sctp_gather_internal_ifa_flags(struct sctp_ifa *ifa)
119119

120120
ifa6 = (struct in6_ifaddr *)ifa->ifa;
121121
ifa->flags = ifa6->ia6_flags;
122-
if (!MODULE_GLOBAL(ip6_use_deprecated)) {
123-
if (ifa->flags &
124-
IN6_IFF_DEPRECATED) {
122+
if (MODULE_GLOBAL(ip6_use_deprecated)) {
123+
ifa->localifa_flags &= ~SCTP_ADDR_IFA_UNUSEABLE;
124+
} else {
125+
if (ifa->flags & IN6_IFF_DEPRECATED) {
125126
ifa->localifa_flags |= SCTP_ADDR_IFA_UNUSEABLE;
126127
} else {
127128
ifa->localifa_flags &= ~SCTP_ADDR_IFA_UNUSEABLE;
128129
}
129-
} else {
130-
ifa->localifa_flags &= ~SCTP_ADDR_IFA_UNUSEABLE;
131130
}
132-
if (ifa->flags &
133-
(IN6_IFF_DETACHED |
134-
IN6_IFF_ANYCAST |
135-
IN6_IFF_NOTREADY)) {
131+
if (ifa->flags & (IN6_IFF_DETACHED | IN6_IFF_DUPLICATED)) {
132+
ifa->localifa_flags |= SCTP_ADDR_IFA_UNUSEABLE;
133+
}
134+
/* Right now, do not support IPv6 anycast addresses */
135+
if (ifa->flags & IN6_IFF_ANYCAST) {
136136
ifa->localifa_flags |= SCTP_ADDR_IFA_UNUSEABLE;
137-
} else {
138-
ifa->localifa_flags &= ~SCTP_ADDR_IFA_UNUSEABLE;
139137
}
140138
}
141139
#endif /* INET6 */

0 commit comments

Comments
 (0)