diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp index f19a21716..f091bd230 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -68,14 +68,18 @@ LanLinkProvider::LanLinkProvider(bool testMode, quint16 udpBroadcastPort, quint1 if (m_lastConfig != config && config.state() == QNetworkConfiguration::Active) { m_lastConfig = config; onNetworkChange(); - m_mdnsDiscovery.onNetworkChange(); +#ifdef KDECONNECT_MDNS + m_mdnsDiscovery.onNetworkChange(); +#endif } }); #else const auto checkNetworkChange = [this]() { if (QNetworkInformation::instance()->reachability() == QNetworkInformation::Reachability::Online) { onNetworkChange(); - m_mdnsDiscovery.onNetworkChange(); +#ifdef KDECONNECT_MDNS + m_mdnsDiscovery.onNetworkChange(); +#endif } }; // Detect when a network interface changes status, so we announce ourselves in the new network