|
|
@ -483,6 +483,10 @@ QStringList Interface::list() { |
|
|
|
return QStringList(); |
|
|
|
} |
|
|
|
|
|
|
|
// fixes libnl "issue": https://github.com/tgraf/libnl/issues/49
|
|
|
|
// the cache is apparently global to the kernel and must be resynced if a hotplug device goes away and comes back
|
|
|
|
nl_cache_resync(sock, link_cache, NULL, NULL); |
|
|
|
|
|
|
|
int index = 1; |
|
|
|
|
|
|
|
forever { |
|
|
@ -504,17 +508,6 @@ QStringList Interface::list() { |
|
|
|
nl_cache_free(link_cache); |
|
|
|
nl_socket_free(sock); |
|
|
|
|
|
|
|
// workaround for libnl issue: https://github.com/tgraf/libnl/issues/49
|
|
|
|
// find any interfaces libnl doesn't know about (e.g. USB wireless adapters after they're been unplugged and replugged)
|
|
|
|
QDir dir("/sys/class/net"); |
|
|
|
QStringList interfaces = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); |
|
|
|
|
|
|
|
foreach(QString interface, interfaces) { |
|
|
|
if(!linkList.contains(interface)) { |
|
|
|
linkList << interface; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return linkList; |
|
|
|
} |
|
|
|
|
|
|
|