From 14857808ef59c3869ce75825950cce94759af742 Mon Sep 17 00:00:00 2001 From: Youngho Yoon <34558998+yhoyoon@users.noreply.github.com> Date: Tue, 29 Aug 2023 12:46:10 +0900 Subject: [PATCH] Match the order of ScoreIpAddress with IpScore (#28934) The #27981 PR was merged, but it didn't follow IpScore's comments. // IP addess "suitability" // - Larger value means "more suitable" // - Enum ordered ascending for easier read. Note however that order of // checks MUST match in ScoreIpAddress below. enum class IpScore : unsigned This change matches the order of ScoreIpAddress with the order of IpScore enum. Signed-off-by: Youngho Yoon <34558998+yhoyoon@users.noreply.github.com> --- src/lib/dnssd/IPAddressSorter.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/lib/dnssd/IPAddressSorter.cpp b/src/lib/dnssd/IPAddressSorter.cpp index 36bd2b109b3ab2..18147c4e2e9ba4 100644 --- a/src/lib/dnssd/IPAddressSorter.cpp +++ b/src/lib/dnssd/IPAddressSorter.cpp @@ -45,12 +45,10 @@ IpScore ScoreIpAddress(const Inet::IPAddress & ip, Inet::InterfaceId interfaceId { if (ip.IsIPv6()) { -#ifdef __APPLE__ if (ip.IsIPv6LinkLocal()) { return IpScore::kLinkLocal; } -#endif // __APPLE__ if (interfaceId.MatchLocalIPv6Subnet(ip)) { @@ -73,13 +71,6 @@ IpScore ScoreIpAddress(const Inet::IPAddress & ip, Inet::InterfaceId interfaceId return IpScore::kUniqueLocal; } -#ifndef __APPLE__ - if (ip.IsIPv6LinkLocal()) - { - return IpScore::kLinkLocal; - } -#endif // __APPLE__ - return IpScore::kOtherIpv6; }