Bug 230242 - [sctp] SCTP uses deprecated IPv6 addresses
Summary: [sctp] SCTP uses deprecated IPv6 addresses
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Michael Tuexen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-31 14:54 UTC by Timo Voelker
Modified: 2020-10-22 13:09 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Voelker 2018-07-31 14:54:45 UTC
My router sometimes sends IPv6 Prefixes with a lifetime of 0. My FreeBSD box creates an IPv6 address from the prefix and adds it as deprecated address to the interface. So far so good.

The problem is that SCTP sometimes uses one of the deprecated addresses to initiate a new association. Since the deprecated addresses are no valid addresses in my configuration, this fails.

For me it looks like the sysctl variable net.inet6.ip6.use_deprecated is misinterpreted. The RFC

https://tools.ietf.org/html/rfc2462#section-5.5.4

says, if activated, use deprecated address in open associations, only. It seems SCTP uses deprecated addresses even for new associations, if the variable is activated. 

In https://svnweb.freebsd.org/base/head/sys/netinet/sctp_bsd_addr.c starting from line 126 a interface address gets marked as SCTP_ADDR_IFA_UNUSEABLE only, if ip6_use_deprecated is false (which is basically net.inet6.ip6.use_deprecated) and the interface address is marked as IN6_IFF_DEPRECATED. Maybe this is the right position to start fixing this issue.

Thanks,

Timo