From 0249833848bb07a37692f9aaa3892e16f3938403 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Thu, 13 Sep 2018 21:38:39 +0200 Subject: [PATCH] don't show link-lokal IPv6 addresses, they're useless --- libnymea-app-core/discovery/zeroconfdiscovery.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libnymea-app-core/discovery/zeroconfdiscovery.cpp b/libnymea-app-core/discovery/zeroconfdiscovery.cpp index d88aa44c..ea8097ea 100644 --- a/libnymea-app-core/discovery/zeroconfdiscovery.cpp +++ b/libnymea-app-core/discovery/zeroconfdiscovery.cpp @@ -44,9 +44,19 @@ bool ZeroconfDiscovery::discovering() const #ifdef WITH_ZEROCONF void ZeroconfDiscovery::serviceEntryAdded(const QZeroConfService &entry) { - if (!entry.name().startsWith("nymea") || (entry.ip().isNull() && entry.ipv6().isNull())) { + if (!entry.name().startsWith("nymea")) { + // Skip non-nymea services altogether return; } + if (entry.ip().isNull() && entry.ipv6().isNull()) { + // Skip entries that don't have an ip address at all for some reason + return; + } + if (entry.ipv6().toString().startsWith("fe80")) { + // Skip link-local IPv6 addresses + return; + } + // qDebug() << "zeroconf service discovered" << entry << entry.ip() << entry.ipv6() << entry.txt() << entry.type(); QString uuid;