Skip to content

Commit

Permalink
Workaround: skip check for ipv6 support (by @nexplorer-3e)
Browse files Browse the repository at this point in the history
The commit is made instead of PR merge because the PR has a weird file in it
  • Loading branch information
Mathias-Boulay committed Jul 27, 2024
1 parent 471ca51 commit 691cab3
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
21 changes: 21 additions & 0 deletions patches/jre_17/android/26_skip_proc_net6_check.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// skip some checks as AOSP does
diff --git a/src/java.base/unix/native/libnet/net_util_md.c b/src/java.base/unix/native/libnet/net_util_md.c
index 4ec11a136..01b85db4d 100644
--- a/src/java.base/unix/native/libnet/net_util_md.c
+++ b/src/java.base/unix/native/libnet/net_util_md.c
@@ -129,6 +129,7 @@ jint IPv6_supported()
SOCKETADDRESS sa;
socklen_t sa_len = sizeof(SOCKETADDRESS);

+#ifndef __ANDROID__ // ANDROID: skip check, see libcore commit ae218d9b
fd = socket(AF_INET6, SOCK_STREAM, 0) ;
if (fd < 0) {
/*
@@ -172,6 +173,7 @@ jint IPv6_supported()
}
}
#endif
+#endif // !defined __ANDROID__

/*
* OK we may have the stack available in the kernel,
21 changes: 21 additions & 0 deletions patches/jre_21/android/26_skip_proc_net6_check.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// skip some checks as AOSP does
diff --git a/src/java.base/unix/native/libnet/net_util_md.c b/src/java.base/unix/native/libnet/net_util_md.c
index 4ec11a136..01b85db4d 100644
--- a/src/java.base/unix/native/libnet/net_util_md.c
+++ b/src/java.base/unix/native/libnet/net_util_md.c
@@ -129,6 +129,7 @@ jint IPv6_supported()
SOCKETADDRESS sa;
socklen_t sa_len = sizeof(SOCKETADDRESS);

+#ifndef __ANDROID__ // ANDROID: skip check, see libcore commit ae218d9b
fd = socket(AF_INET6, SOCK_STREAM, 0) ;
if (fd < 0) {
/*
@@ -172,6 +173,7 @@ jint IPv6_supported()
}
}
#endif
+#endif // !defined __ANDROID__

/*
* OK we may have the stack available in the kernel,
20 changes: 20 additions & 0 deletions patches/jre_21/android/jdk21u_android.diff
Original file line number Diff line number Diff line change
Expand Up @@ -2258,6 +2258,26 @@ index 21ef40688..b8c2520d2 100644
#endif

if (exec_path == NULL) {
diff --git a/src/java.base/unix/native/libnet/net_util_md.c b/src/java.base/unix/native/libnet/net_util_md.c
index 4ec11a136..01b85db4d 100644
--- a/src/java.base/unix/native/libnet/net_util_md.c
+++ b/src/java.base/unix/native/libnet/net_util_md.c
@@ -129,6 +129,7 @@ jint IPv6_supported()
SOCKETADDRESS sa;
socklen_t sa_len = sizeof(SOCKETADDRESS);

+#ifndef __ANDROID__ // ANDROID: skip check, see libcore commit ae218d9b
fd = socket(AF_INET6, SOCK_STREAM, 0) ;
if (fd < 0) {
/*
@@ -172,6 +173,7 @@ jint IPv6_supported()
}
}
#endif
+#endif // !defined __ANDROID__

/*
* OK we may have the stack available in the kernel,
diff --git a/src/java.base/unix/native/libnet/net_util_md.h b/src/java.base/unix/native/libnet/net_util_md.h
index 902cf9673..3b8acd66b 100644
--- a/src/java.base/unix/native/libnet/net_util_md.h
Expand Down

0 comments on commit 691cab3

Please sign in to comment.