diff options
author | Peter Hartmann <peter.hartmann@trolltech.com> | 2009-04-01 09:21:45 (GMT) |
---|---|---|
committer | Peter Hartmann <peter.hartmann@trolltech.com> | 2009-04-01 10:40:23 (GMT) |
commit | 7ff89f9ee6d7c11a42300299cb699185dc020379 (patch) | |
tree | 0941b2a5d795b4859a57db8c656e556316959a14 | |
parent | 5ec8a27470d4004a60a2d9fc6bd757bbebae1fd7 (diff) | |
download | Qt-7ff89f9ee6d7c11a42300299cb699185dc020379.zip Qt-7ff89f9ee6d7c11a42300299cb699185dc020379.tar.gz Qt-7ff89f9ee6d7c11a42300299cb699185dc020379.tar.bz2 |
QNetworkInterface: fix listing of all interfaces
Before, we returned 0 for many interfaces because we picked up the IPv6
address regardless whether it was 0 or not.
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Task-number: 249312
-rw-r--r-- | src/network/kernel/qnetworkinterface_win.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/kernel/qnetworkinterface_win.cpp b/src/network/kernel/qnetworkinterface_win.cpp index 9540c18..de97629 100644 --- a/src/network/kernel/qnetworkinterface_win.cpp +++ b/src/network/kernel/qnetworkinterface_win.cpp @@ -173,14 +173,14 @@ static QList<QNetworkInterfacePrivate *> interfaceListingWinXP() interfaces << iface; iface->index = 0; - if (ptr->Length >= offsetof(IP_ADAPTER_ADDRESSES, Ipv6IfIndex)) + if (ptr->Length >= offsetof(IP_ADAPTER_ADDRESSES, Ipv6IfIndex) && ptr->Ipv6IfIndex != 0) iface->index = ptr->Ipv6IfIndex; else if (ptr->IfIndex != 0) iface->index = ptr->IfIndex; iface->flags = QNetworkInterface::CanBroadcast; - if (ptr->OperStatus == IfOperStatusUp) - iface->flags |= QNetworkInterface::IsUp | QNetworkInterface::IsRunning; + if (ptr->OperStatus == IfOperStatusUp) + iface->flags |= QNetworkInterface::IsUp | QNetworkInterface::IsRunning; if ((ptr->Flags & IP_ADAPTER_NO_MULTICAST) == 0) iface->flags |= QNetworkInterface::CanMulticast; |