From 0856f3b223482a5335f153b53b147628a18952f4 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Thu, 23 May 2024 11:08:24 +0100 Subject: [PATCH] DEV9: Shuffle code in Linux GetAdapter Giving same flow as Windows code --- pcsx2/DEV9/AdapterUtils.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pcsx2/DEV9/AdapterUtils.cpp b/pcsx2/DEV9/AdapterUtils.cpp index 1dff8e35b7..1d38da1674 100644 --- a/pcsx2/DEV9/AdapterUtils.cpp +++ b/pcsx2/DEV9/AdapterUtils.cpp @@ -204,18 +204,15 @@ bool AdapterUtils::GetAdapter(const std::string& name, Adapter* adapter, Adapter if (pAdapter->ifa_addr != nullptr && ReadAddressFamily(pAdapter->ifa_addr) == AF_INET && strcmp(pAdapter->ifa_name, name.c_str()) == 0) - break; + { + *adapter = *pAdapter; + buffer->swap(adapterInfo); + return true; + } pAdapter = pAdapter->ifa_next; } while (pAdapter); - if (pAdapter != nullptr) - { - *adapter = *pAdapter; - buffer->swap(adapterInfo); - return true; - } - return false; } bool AdapterUtils::GetAdapterAuto(Adapter* adapter, AdapterBuffer* buffer)