Browse Source

Merge branch 'master' of ssh://10.0.4.44:54649/home/bp/work/libip

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

15
interface.cpp

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

Loading…
Cancel
Save