summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qnetworkinterface_unix.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-12-02 10:27:54 -0800
committerThiago Macieira <thiago.macieira@intel.com>2016-01-21 05:19:08 +0000
commit043f5d3eb52587831f643bc52c95079c36d984c7 (patch)
tree9e64fa3adf7432cc4b9438df70ec7b70865ac8fa /src/network/kernel/qnetworkinterface_unix.cpp
parent7b2fb038ae4b8b9231ae989ad309b6eca107a858 (diff)
QNetworkInterface: fix handling of interfaces with no addresses
Certain Linux interfaces have no addresses at all (hardware or IP), like the nlmon interfaces. They weren't being reported. Change-Id: I8de47ed6c7be4847b99bffff141c2b60c2089ad3 Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/network/kernel/qnetworkinterface_unix.cpp')
-rw-r--r--src/network/kernel/qnetworkinterface_unix.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/kernel/qnetworkinterface_unix.cpp b/src/network/kernel/qnetworkinterface_unix.cpp
index 5e6d24dd44..b734476dc2 100644
--- a/src/network/kernel/qnetworkinterface_unix.cpp
+++ b/src/network/kernel/qnetworkinterface_unix.cpp
@@ -343,7 +343,7 @@ static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
// - virtual interfaces with no HW address have no AF_PACKET
// - interface labels have no AF_PACKET, but shouldn't be shown as a new interface
for (ifaddrs *ptr = rawList; ptr; ptr = ptr->ifa_next) {
- if (ptr->ifa_addr && ptr->ifa_addr->sa_family != AF_PACKET) {
+ if (!ptr->ifa_addr || ptr->ifa_addr->sa_family != AF_PACKET) {
QString name = QString::fromLatin1(ptr->ifa_name);
if (seenInterfaces.contains(name))
continue;