NLAddress gives an address's family, prefix length and scope but not its
flags, so a consumer cannot tell a tentative IPv6 address (duplicate
address detection under way, RFC 4862 Section 5.4) from a usable one, nor a
temporary privacy address (RFC 8981) from a stable one. A tentative address
cannot be bound until detection completes, which the kernel reports with
another RTM_NEWADDR, so a socket that follows an interface's addresses
needs the flag to know when an address becomes usable.
NLAddress.flags returns rtnl_addr_get_flags(), which libnl fills from
IFA_FLAGS (or ifa_flags where the kernel sends no IFA_FLAGS). The new test
checks that lo's ::1 is permanent and not tentative.
Verified: swift build, swift test on Linux.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGwDLWmm5YyBZxTTbMpieC