1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Merge pull request #91 from rklabs/fix_tunnel_interface

Allow no HW address on interfaces when looking up their info (TUN ifaces)
This commit is contained in:
Matias Fontanini
2015-07-22 10:11:55 -07:00

View File

@@ -224,10 +224,12 @@ NetworkInterface::Info NetworkInterface::info() const {
InterfaceInfoCollector collector(&info, iface_id, iface_name.c_str());
info.is_up = false;
Utils::generic_iface_loop(collector);
// If we didn't event get the hw address, this went wrong
if(!collector.found_hw) {
// If we didn't even get the hw address or ip address, this went wrong
if(!collector.found_hw && !collector.found_ip) {
throw std::runtime_error("Error looking up interface address");
}
return info;
}