Imported Upstream version 4.2.1.36

Former-commit-id: f3008ca867fe7e4b7ae9b9a8844c0ad5798925a9
This commit is contained in:
Xamarin Public Jenkins
2015-09-24 06:06:07 -04:00
committed by Jo Shields
parent afe402035c
commit ea5caba957
172 changed files with 6570 additions and 11015 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2007-2013 Jeroen Frijters
Copyright (C) 2007-2015 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -28,6 +28,36 @@ using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Security;
static class Java_java_net_AbstractPlainDatagramSocketImpl
{
public static void init()
{
}
public static int dataAvailable(object _this)
{
#if FIRST_PASS
return 0;
#else
try
{
java.net.AbstractPlainDatagramSocketImpl obj = (java.net.AbstractPlainDatagramSocketImpl)_this;
if (obj.fd != null)
{
return obj.fd.getSocket().Available;
}
}
catch (ObjectDisposedException)
{
}
catch (SocketException)
{
}
throw new java.net.SocketException("Socket closed");
#endif
}
}
static class Java_java_net_DatagramPacket
{
public static void init()
@@ -436,6 +466,7 @@ static class Java_java_net_NetworkInterface
int lo = 0;
int ppp = 0;
int sl = 0;
int wlan = 0;
int net = 0;
for (int i = 0; i < ifaces.Length; i++)
{
@@ -465,6 +496,9 @@ static class Java_java_net_NetworkInterface
case NetworkInterfaceType.Slip:
name = "sl" + sl++;
break;
case NetworkInterfaceType.Wireless80211:
name = "wlan" + wlan++;
break;
default:
name = "net" + net++;
break;
@@ -480,6 +514,13 @@ static class Java_java_net_NetworkInterface
IPAddress addr = uipaic[j].Address;
if (addr.AddressFamily == AddressFamily.InterNetwork)
{
if (ifaces[i].OperationalStatus != OperationalStatus.Up)
{
// HACK on Windows, OpenJDK seems to only return IPv4 addresses for interfaces that are up.
// This is possibly the result of their usage of the (legacy) Win32 API GetIpAddrTable.
// Not doing this filtering causes some OpenJDK tests to fail.
continue;
}
java.net.Inet4Address address = new java.net.Inet4Address(null, addr.GetAddressBytes());
java.net.InterfaceAddress binding = new java.net.InterfaceAddress();
short mask = 32;