Bläddra i källkod

Filter out link-local IPv6 addresses

As it was suggested by someone.
Vincent Lang 9 år sedan
förälder
incheckning
e7bbf557a0
1 ändrade filer med 5 tillägg och 1 borttagningar
  1. 5 1
      src/system/SystemComponent.cpp

+ 5 - 1
src/system/SystemComponent.cpp

@@ -242,7 +242,11 @@ QStringList SystemComponent::networkAddresses() const
   {
     if (! address.isLoopback() && (address.protocol() == QAbstractSocket::IPv4Protocol ||
                                    address.protocol() == QAbstractSocket::IPv6Protocol))
-      list << address.toString();
+    {
+      auto s = address.toString();
+      if (!s.startsWith("fe80::"))
+        list << s;
+    }
   }
 
   return list;