Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cherrypick] Change to prefer IPv6 link local address #28691

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions src/lib/dnssd/IPAddressSorter.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,13 @@ enum class IpScore : unsigned
// "Other" IPv6 include:
// - invalid addresses (have seen router bugs during interop testing)
// - embedded IPv4 (::/80)
kOtherIpv6 = 1,
kIpv4 = 2, // Not Matter SPEC, so low priority
#ifdef __APPLE__
kOtherIpv6 = 1,
kIpv4 = 2, // Not Matter SPEC, so low priority
kUniqueLocal = 3, // ULA. Thread devices use this
kGlobalUnicast = 4, // Maybe routable, not local subnet
kUniqueLocalWithSharedPrefix = 5, // Prefix seems to match a local interface
kGlobalUnicastWithSharedPrefix = 6, // Prefix seems to match a local interface
kLinkLocal = 7, // Valid only on an interface
#else
kLinkLocal = 3, // Valid only on an interface
kUniqueLocal = 4, // ULA. Thread devices use this
kGlobalUnicast = 5, // Maybe routable, not local subnet
kUniqueLocalWithSharedPrefix = 6, // Prefix seems to match a local interface
kGlobalUnicastWithSharedPrefix = 7, // Prefix seems to match a local interface
#endif // __APPLE__
};

void Sort(Inet::IPAddress * addresses, size_t count, Inet::InterfaceId interfaceId);
Expand Down