Browse Source

revert merge

master
Brad Parker 11 years ago
parent
commit
3258ef5f29
  1. 15
      interface.cpp

15
interface.cpp

@ -509,10 +509,6 @@ 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 {
@ -534,6 +530,17 @@ 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;
}

Loading…
Cancel
Save