From 226c81ce78c9823050ba2247d1de58e95677da6c Mon Sep 17 00:00:00 2001 From: tt2468 Date: Mon, 25 Apr 2022 20:37:35 -0700 Subject: [PATCH] utils/Platform: Ignore virtualbox interface IP Somewhat common on systems, so we'll just manually ignore it. Closes #928 --- src/utils/Platform.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/Platform.cpp b/src/utils/Platform.cpp index 41becdf4..9079d88b 100644 --- a/src/utils/Platform.cpp +++ b/src/utils/Platform.cpp @@ -54,7 +54,10 @@ std::string Utils::Platform::GetLocalAddress() 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 - preferredAddresses.push_back(std::make_pair(address, 0)); + if (address.startsWith("192.168.56.")) + preferredAddresses.push_back(std::make_pair(address, 255)); // Ignore virtualbox default + else + preferredAddresses.push_back(std::make_pair(address, 0)); } 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