QNetworkInterface: fix reporting of virtual interfaces on Linux

We checked if we had seen the interface by looking into seenInterfaces
and seenIndexes, but we never updated those variables with what we saw
in this block.

This fixes the reporting of PPP interfaces as well as TUN/TAP virtual
interfaces.

Change-Id: I33dc971f005a4848bb8ffffd1476830b8482b808
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Thiago Macieira 2016-09-21 19:06:53 -07:00
parent d95cb94baa
commit 456ae0dfeb

View File

@ -352,6 +352,9 @@ static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
if (seenIndexes.contains(ifindex))
continue;
seenInterfaces.insert(name);
seenIndexes.append(ifindex);
QNetworkInterfacePrivate *iface = new QNetworkInterfacePrivate;
interfaces << iface;
iface->name = name;