From 375f56506089f98118aa1848ed9f05a35e212c90 Mon Sep 17 00:00:00 2001 From: Karsten Heimrich Date: Thu, 22 Aug 2019 15:12:56 +0200 Subject: 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 Reviewed-by: Karsten Heimrich Reviewed-by: Christian Ehrlicher --- src/network/kernel/qnetworkinterface_unix.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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 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)); -- cgit v1.2.3