]> git.meshlink.io Git - catta/commitdiff
skip transient ("cluster") addresses on Windows, as per MSDN
authorSven M. Hallberg <pesco@khjk.org>
Mon, 8 Sep 2014 20:01:40 +0000 (22:01 +0200)
committerSven M. Hallberg <pesco@khjk.org>
Mon, 8 Sep 2014 20:01:40 +0000 (22:01 +0200)
src/iface-windows.c

index 2c05bfe9f4da66251749bf4a5afc30597f7d3ac0..729e3c4635617bad29ec6b7618054f6348f4e1ad 100644 (file)
@@ -39,6 +39,12 @@ static void ip_adapter_unicast_address(CattaInterfaceMonitor *m,
     CattaInterfaceAddress *ifaddr;
     struct sockaddr *sa = a->Address.lpSockaddr;
 
+    // skip transient addresses; to quote MSDN: "The IP address is a cluster
+    // address and should not be used by most applications."
+    // http://msdn.microsoft.com/en-us/library/windows/desktop/aa366066(v=vs.85).aspx
+    if(a->Flags & IP_ADAPTER_ADDRESS_TRANSIENT)
+        return;
+
     // fill addr struct for address lookup
     switch(sa->sa_family) {
     case AF_INET: