提交 9cb71a4a 编写于 作者: A asaha

Merge

...@@ -746,6 +746,7 @@ dbf817e782805bffcb9a0d84f452349926329d62 jdk8u152-b02 ...@@ -746,6 +746,7 @@ dbf817e782805bffcb9a0d84f452349926329d62 jdk8u152-b02
4c95cacb8ec77cbda2ae1d4e070b39ec6b527769 jdk8u152-b04 4c95cacb8ec77cbda2ae1d4e070b39ec6b527769 jdk8u152-b04
9c692f8574178a5505efe39cdff1ea92d4f95cbd jdk8u152-b05 9c692f8574178a5505efe39cdff1ea92d4f95cbd jdk8u152-b05
636043375508d667052c84691c55d4c633376dbe jdk8u152-b06 636043375508d667052c84691c55d4c633376dbe jdk8u152-b06
83998ef9e0b96e1f5f9d4667575a81e8aa06b981 jdk8u152-b07
1442bc728814af451e2dd1a6719a64485d27e3a0 jdk8u122-b00 1442bc728814af451e2dd1a6719a64485d27e3a0 jdk8u122-b00
f6030acfa5aec0e64d45adfac69b9e7e5c12bc74 jdk8u122-b01 f6030acfa5aec0e64d45adfac69b9e7e5c12bc74 jdk8u122-b01
6b072c3a6db7ab06804c91aab77431799dfb5d47 jdk8u122-b02 6b072c3a6db7ab06804c91aab77431799dfb5d47 jdk8u122-b02
......
...@@ -1267,7 +1267,7 @@ static int getMacAddress ...@@ -1267,7 +1267,7 @@ static int getMacAddress
(JNIEnv *env, const char *ifname, const struct in_addr *addr, (JNIEnv *env, const char *ifname, const struct in_addr *addr,
unsigned char *buf) unsigned char *buf)
{ {
static struct ifreq ifr; struct ifreq ifr;
int i, sock; int i, sock;
if ((sock = openSocketWithFallback(env, ifname)) < 0) { if ((sock = openSocketWithFallback(env, ifname)) < 0) {
......
...@@ -48,6 +48,7 @@ JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_initIDs ...@@ -48,6 +48,7 @@ JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_initIDs
isa_ctorID = (*env)->GetMethodID(env, cls, "<init>", isa_ctorID = (*env)->GetMethodID(env, cls, "<init>",
"(Ljava/net/InetAddress;I)V"); "(Ljava/net/InetAddress;I)V");
CHECK_NULL(isa_ctorID); CHECK_NULL(isa_ctorID);
initInetAddressIDs(env);
// implement read timeout with select. // implement read timeout with select.
isRcvTimeoutSupported = 0; isRcvTimeoutSupported = 0;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/* /*
* @test * @test
* @bug 4106601 8026245 * @bug 4106601 8026245 8071424
* @run main/othervm GetLocalAddress * @run main/othervm GetLocalAddress
* @run main/othervm -Djava.net.preferIPv4Stack=true GetLocalAddress * @run main/othervm -Djava.net.preferIPv4Stack=true GetLocalAddress
* @run main/othervm -Djava.net.preferIPv6Addresses=true GetLocalAddress * @run main/othervm -Djava.net.preferIPv6Addresses=true GetLocalAddress
...@@ -39,6 +39,8 @@ public class GetLocalAddress implements Runnable { ...@@ -39,6 +39,8 @@ public class GetLocalAddress implements Runnable {
static int port; static int port;
public static void main(String args[]) throws Exception { public static void main(String args[]) throws Exception {
testBindNull();
boolean error = true; boolean error = true;
int linger = 65546; int linger = 65546;
int value = 0; int value = 0;
...@@ -66,4 +68,19 @@ public class GetLocalAddress implements Runnable { ...@@ -66,4 +68,19 @@ public class GetLocalAddress implements Runnable {
} }
} }
static void testBindNull() throws Exception {
try (Socket soc = new Socket()) {
soc.bind(null);
if (!soc.isBound())
throw new RuntimeException(
"should be bound after bind(null)");
if (soc.getLocalPort() <= 0)
throw new RuntimeException(
"bind(null) failed, local port: " + soc.getLocalPort());
if (soc.getLocalAddress() == null)
throw new RuntimeException(
"bind(null) failed, local address is null");
}
}
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册