From ed79da92e05f91afc57c6da57349c802ba1b4af5 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sun, 6 Jun 2021 00:02:59 -0700 Subject: [PATCH] Utils::Platform: Fix minor ip recognition bug --- src/utils/Platform.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/Platform.cpp b/src/utils/Platform.cpp index 5dc21dff..0fb0be9b 100644 --- a/src/utils/Platform.cpp +++ b/src/utils/Platform.cpp @@ -35,9 +35,9 @@ std::string Utils::Platform::GetLocalAddress() std::vector> preferredAddresses; for (auto address : validAddresses) { // Attribute a priority (0 is best) to the address to choose the best picks - if (address.startsWith("192.168.1") || address.startsWith("192.168.0")) { // Prefer common consumer router network prefixes + if (address.startsWith("192.168.1.") || address.startsWith("192.168.0.")) { // Prefer common consumer router network prefixes preferredAddresses.push_back(std::make_pair(address, 0)); - } else if (address.startsWith("172.16")) { // Slightly less common consumer router network prefixes + } else if (address.startsWith("172.16.")) { // Slightly less common consumer router network prefixes preferredAddresses.push_back(std::make_pair(address, 1)); } else if (address.startsWith("10.")) { // Even less common consumer router network prefixes preferredAddresses.push_back(std::make_pair(address, 2));