Merge pull request #4003 from ntherning/ignore-disconnected-interfaces-in-HttpListene...
authorNiklas Therning <niklas@therning.org>
Tue, 22 Nov 2016 19:03:22 +0000 (20:03 +0100)
committerGitHub <noreply@github.com>
Tue, 22 Nov 2016 19:03:22 +0000 (20:03 +0100)
Ignore disconnected interfaces in HttpListenerRequestTest.HttpRequestIsLocal

mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs

index d782103f33e33709321e1c7f2211d2b4fccf8a90..18dedcae32dbe27dbc0f7863ae84c0b22c0b7130 100644 (file)
@@ -211,6 +211,8 @@ namespace MonoTests.System.Net
                        var ips = new List<IPAddress> ();
                        ips.Add (IPAddress.Loopback);
                        foreach (var adapter in NetworkInterface.GetAllNetworkInterfaces ()) {
+                               if (adapter.OperationalStatus != OperationalStatus.Up)
+                                       continue;
                                foreach (var ip in adapter.GetIPProperties ().UnicastAddresses) {
                                        ips.Add (ip.Address);
                                }