aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/sctp_bsd_addr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/sctp_bsd_addr.c')
-rw-r--r--sys/netinet/sctp_bsd_addr.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/sys/netinet/sctp_bsd_addr.c b/sys/netinet/sctp_bsd_addr.c
index a10fbcc5ca40..ac715d8298ec 100644
--- a/sys/netinet/sctp_bsd_addr.c
+++ b/sys/netinet/sctp_bsd_addr.c
@@ -117,25 +117,26 @@ sctp_gather_internal_ifa_flags(struct sctp_ifa *ifa)
{
struct in6_ifaddr *ifa6;
+ KASSERT(ifa->address.sa.sa_family == AF_INET6,
+ ("sctp_gather_internal_ifa_flags() called with address family %u",
+ ifa->address.sa.sa_family));
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 */