Skip to content

Commit

Permalink
fix: check getifaddrs return value
Browse files Browse the repository at this point in the history
Also, rebuild Wolf image in order to bring games-on-whales/gow#179
  • Loading branch information
ABeltramo committed Jul 16, 2024
1 parent 45bd103 commit 1a31b93
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/moonlight-server/platforms/hw_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,13 @@ std::string get_ip_address(ifaddrs *ifa) {

std::string get_mac_address(std::string_view local_ip) {
ifaddrs *ifaddrptr = nullptr;
getifaddrs(&ifaddrptr);
if (getifaddrs(&ifaddrptr) == -1) {
logs::log(logs::warning,
"Unable to get ifaddrs: {} . You can override this by settings the env variables "
"WOLF_INTERNAL_MAC or WOLF_INTERNAL_IP",
strerror(errno));
return "00:00:00:00:00:00";
}
std::unique_ptr<ifaddrs, decltype(&freeifaddrs)> ifAddrStruct = {ifaddrptr, ::freeifaddrs};

// First: search for the interface name that has the same IP address
Expand Down

0 comments on commit 1a31b93

Please sign in to comment.