1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-24 19:21:35 +01:00

Added check for localhost ip address on Utils::interface_from_ip.

This commit is contained in:
Matias Fontanini
2012-03-18 19:40:03 -03:00
parent fd09f11ad5
commit f06bf568d5

View File

@@ -207,6 +207,8 @@ bool Tins::Utils::resolve_hwaddr(const string &iface, uint32_t ip, uint8_t *buff
}
string Tins::Utils::interface_from_ip(uint32_t ip) {
if(ip == 0x7f000001)
return "lo";
ifstream input("/proc/net/route");
bool match(false);
string iface;