From e9b471dc34c6b4b13c362658f89f1711486f0777 Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" Date: Mon, 8 Sep 2014 22:01:40 +0200 Subject: [PATCH] skip transient ("cluster") addresses on Windows, as per MSDN --- src/iface-windows.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/iface-windows.c b/src/iface-windows.c index 2c05bfe..729e3c4 100644 --- a/src/iface-windows.c +++ b/src/iface-windows.c @@ -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: -- 2.39.2