diff options
author | Karsten Heimrich <karsten.heimrich@qt.io> | 2019-08-22 15:12:56 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@qt.io> | 2019-08-28 13:05:18 +0200 |
commit | 375f56506089f98118aa1848ed9f05a35e212c90 (patch) | |
tree | 34d1fa4de7e84c5abf439b215ce30ef5a8c2a59c /src/network | |
parent | eb8d46117124c3deee4fbf462bb7201778f50f2b (diff) |
Fix reporting the network interface type on macOS 10.14.5 and later
* initialize the structure used as argument to ioctl SIOCGIFMEDIA
The ioctl in ifType(...) returned -1 and set errno to EFAULT, thus
the code to determine the interface type was not executed.
Task-number: QTBUG-76408
Change-Id: Ib69c2c0cd4dda3604d568adf9746e0c9a280e9a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/kernel/qnetworkinterface_unix.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/network/kernel/qnetworkinterface_unix.cpp b/src/network/kernel/qnetworkinterface_unix.cpp index c28c5ea9e6..4c57bff3bc 100644 --- a/src/network/kernel/qnetworkinterface_unix.cpp +++ b/src/network/kernel/qnetworkinterface_unix.cpp @@ -485,6 +485,7 @@ static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList) struct ifreq req; }; int socket = -1; + memset(&mediareq, 0, sizeof(mediareq)); // ensure both structs start with the name field, of size IFNAMESIZ Q_STATIC_ASSERT(sizeof(mediareq.ifm_name) == sizeof(req.ifr_name)); |