Skip to content

Commit 691cab3

Browse files
Workaround: skip check for ipv6 support (by @nexplorer-3e)
The commit is made instead of PR merge because the PR has a weird file in it
1 parent 471ca51 commit 691cab3

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// skip some checks as AOSP does
2+
diff --git a/src/java.base/unix/native/libnet/net_util_md.c b/src/java.base/unix/native/libnet/net_util_md.c
3+
index 4ec11a136..01b85db4d 100644
4+
--- a/src/java.base/unix/native/libnet/net_util_md.c
5+
+++ b/src/java.base/unix/native/libnet/net_util_md.c
6+
@@ -129,6 +129,7 @@ jint IPv6_supported()
7+
SOCKETADDRESS sa;
8+
socklen_t sa_len = sizeof(SOCKETADDRESS);
9+
10+
+#ifndef __ANDROID__ // ANDROID: skip check, see libcore commit ae218d9b
11+
fd = socket(AF_INET6, SOCK_STREAM, 0) ;
12+
if (fd < 0) {
13+
/*
14+
@@ -172,6 +173,7 @@ jint IPv6_supported()
15+
}
16+
}
17+
#endif
18+
+#endif // !defined __ANDROID__
19+
20+
/*
21+
* OK we may have the stack available in the kernel,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// skip some checks as AOSP does
2+
diff --git a/src/java.base/unix/native/libnet/net_util_md.c b/src/java.base/unix/native/libnet/net_util_md.c
3+
index 4ec11a136..01b85db4d 100644
4+
--- a/src/java.base/unix/native/libnet/net_util_md.c
5+
+++ b/src/java.base/unix/native/libnet/net_util_md.c
6+
@@ -129,6 +129,7 @@ jint IPv6_supported()
7+
SOCKETADDRESS sa;
8+
socklen_t sa_len = sizeof(SOCKETADDRESS);
9+
10+
+#ifndef __ANDROID__ // ANDROID: skip check, see libcore commit ae218d9b
11+
fd = socket(AF_INET6, SOCK_STREAM, 0) ;
12+
if (fd < 0) {
13+
/*
14+
@@ -172,6 +173,7 @@ jint IPv6_supported()
15+
}
16+
}
17+
#endif
18+
+#endif // !defined __ANDROID__
19+
20+
/*
21+
* OK we may have the stack available in the kernel,

patches/jre_21/android/jdk21u_android.diff

+20
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,26 @@ index 21ef40688..b8c2520d2 100644
22582258
#endif
22592259

22602260
if (exec_path == NULL) {
2261+
diff --git a/src/java.base/unix/native/libnet/net_util_md.c b/src/java.base/unix/native/libnet/net_util_md.c
2262+
index 4ec11a136..01b85db4d 100644
2263+
--- a/src/java.base/unix/native/libnet/net_util_md.c
2264+
+++ b/src/java.base/unix/native/libnet/net_util_md.c
2265+
@@ -129,6 +129,7 @@ jint IPv6_supported()
2266+
SOCKETADDRESS sa;
2267+
socklen_t sa_len = sizeof(SOCKETADDRESS);
2268+
2269+
+#ifndef __ANDROID__ // ANDROID: skip check, see libcore commit ae218d9b
2270+
fd = socket(AF_INET6, SOCK_STREAM, 0) ;
2271+
if (fd < 0) {
2272+
/*
2273+
@@ -172,6 +173,7 @@ jint IPv6_supported()
2274+
}
2275+
}
2276+
#endif
2277+
+#endif // !defined __ANDROID__
2278+
2279+
/*
2280+
* OK we may have the stack available in the kernel,
22612281
diff --git a/src/java.base/unix/native/libnet/net_util_md.h b/src/java.base/unix/native/libnet/net_util_md.h
22622282
index 902cf9673..3b8acd66b 100644
22632283
--- a/src/java.base/unix/native/libnet/net_util_md.h

0 commit comments

Comments
 (0)