summaryrefslogtreecommitdiffstats
path: root/src/core/network/network_interface.cpp
diff options
context:
space:
mode:
authorSönke Holz <sholz8530@gmail.com>2021-08-12 22:15:48 +0200
committerSönke Holz <sholz8530@gmail.com>2021-08-12 22:15:48 +0200
commit21743daf38f19160baa2da0e939a4e945dd57228 (patch)
tree99b45f0de20ddfde64a25d9cb42d0f328c0858fc /src/core/network/network_interface.cpp
parentconfiguration: add option to select network interface (diff)
downloadyuzu-21743daf38f19160baa2da0e939a4e945dd57228.tar
yuzu-21743daf38f19160baa2da0e939a4e945dd57228.tar.gz
yuzu-21743daf38f19160baa2da0e939a4e945dd57228.tar.bz2
yuzu-21743daf38f19160baa2da0e939a4e945dd57228.tar.lz
yuzu-21743daf38f19160baa2da0e939a4e945dd57228.tar.xz
yuzu-21743daf38f19160baa2da0e939a4e945dd57228.tar.zst
yuzu-21743daf38f19160baa2da0e939a4e945dd57228.zip
Diffstat (limited to 'src/core/network/network_interface.cpp')
-rw-r--r--src/core/network/network_interface.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/network/network_interface.cpp b/src/core/network/network_interface.cpp
index bba4c8b26..2b53682ea 100644
--- a/src/core/network/network_interface.cpp
+++ b/src/core/network/network_interface.cpp
@@ -12,9 +12,9 @@
#ifdef _WIN32
#include <iphlpapi.h>
#else
+#include <cerrno>
#include <ifaddrs.h>
#include <net/if.h>
-#include <cerrno>
#endif
namespace Network {
@@ -61,8 +61,7 @@ std::vector<NetworkInterface> GetAvailableNetworkInterfaces() {
result.push_back(NetworkInterface{
.name{Common::UTF16ToUTF8(std::wstring{current_address->FriendlyName})},
- .ip_address{ip_addr}
- });
+ .ip_address{ip_addr}});
}
} else {
LOG_ERROR(Network, "Failed to get network interfaces with GetAdaptersAddresses");
@@ -99,8 +98,7 @@ std::vector<NetworkInterface> GetAvailableNetworkInterfaces() {
result.push_back(NetworkInterface{
.name{ifa->ifa_name},
- .ip_address{std::bit_cast<struct sockaddr_in>(*ifa->ifa_addr).sin_addr}
- });
+ .ip_address{std::bit_cast<struct sockaddr_in>(*ifa->ifa_addr).sin_addr}});
}
freeifaddrs(ifaddr);