From 65bd51bf8ef19cb351e2ff7090dd4e4cba4d87e2 Mon Sep 17 00:00:00 2001 From: eval Nya <60149113+nexplorer-3e@users.noreply.github.com> Date: Sun, 28 Jul 2024 02:21:21 +0800 Subject: [PATCH] workaround: libnet: ipv6_support: skip /proc/net/ & socket() check ifdef __ANDROID__ (#27) see https://android.googlesource.com/platform/libcore/+/ae218d9bdc8395ac0ed9278c86cff597915c2a7b%5E%21 this commit is subset of the changes mentioned above and should get further tests before merge into JDK. --- patches/jdk8u_android.diff | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/patches/jdk8u_android.diff b/patches/jdk8u_android.diff index f21c694..801ec26 100644 --- a/patches/jdk8u_android.diff +++ b/patches/jdk8u_android.diff @@ -59882,6 +59882,22 @@ index bd0bd8c2c9..f6273dff47 100644 #include #include #include +@@ -319,6 +319,7 @@ jint IPv6_supported() + SOCKADDR sa; + socklen_t sa_len = sizeof(sa); + ++#ifndef __ANDROID__ // ANDROID: skip check, see libcore commit ae218d9b + fd = JVM_Socket(AF_INET6, SOCK_STREAM, 0) ; + if (fd < 0) { + /* +@@ -363,6 +364,7 @@ jint IPv6_supported() + } + } + #endif ++#endif // !defined __ANDROID__ + + /** + * On Solaris 8 it's possible to create INET6 sockets even @@ -577,7 +581,9 @@ static void initLoopbackRoutes() { */ if ( (dest_plen < 0 || dest_plen > 128) ||