This commit is contained in:
cxh 2026-01-22 10:21:04 +08:00
parent ee06511a84
commit 2d412d2e98

View File

@ -31,7 +31,7 @@ static bool device_exists(const std::string& path)
} }
// 获取指定网卡 IPv4 // 获取指定网卡 IPv4
static std::string get_ip_address(const std::string& ifname) std::string get_ip_address(const std::string& ifname)
{ {
struct ifaddrs* ifaddr = nullptr; struct ifaddrs* ifaddr = nullptr;
if (getifaddrs(&ifaddr) != 0) return ""; if (getifaddrs(&ifaddr) != 0) return "";