mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Utils::Platform: Fix minor ip recognition bug
This commit is contained in:
parent
d3c7f4b3fd
commit
ed79da92e0
@ -35,9 +35,9 @@ std::string Utils::Platform::GetLocalAddress()
|
||||
std::vector<std::pair<QString, uint8_t>> 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));
|
||||
|
Loading…
Reference in New Issue
Block a user