Date: Tue, 31 Jul 2018 13:55:00 +0000 From: =?iso-8859-1?Q?Timo_V=F6lker?= <timo.voelker@fh-muenster.de> To: "freebsd-java@freebsd.org" <freebsd-java@freebsd.org> Subject: SCTP do not work with OpenJDK8 Message-ID: <FD5A4D7B-42E6-4239-80BF-886876AE58DB@fh-muenster.de>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Hi, I found an issue with SCTP support in OpenJDK8 for FreeBSD. In my example https://github.com/msvoelker/java-sctp/ it happened that OpenJDK8 calls sendmsg with an buffer address != NULL and a buffer length of 0, which is an invalid argument for FreeBSD. I found the code lines in the function Java_sun_nio_ch_sctp_SctpChannelImpl_send0 of jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c Besides that, I changed two ifdef statements for FreeBSD. I attach my patch file at the end. If I copy this patch file to the files directory of the OpenJDK8 port, I'm able to install OpenJDK and to run the example application. sudo cp patch-jdk-src-solaris-native-sun-nio-ch-sctp-SctpChannelImpl.c /usr/ports/java/openjdk8/files cd /usr/ports/java/openjdk8 sudo make install I just saw that hwh found this issue already for OpenJDK7. https://lists.freebsd.org/pipermail/freebsd-java/2010-September/008906.html Thanks, Timo patch-jdk-src-solaris-native-sun-nio-ch-sctp-SctpChannelImpl.c --- jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c.org 2018-07-26 09:56:49.897172000 +0200 +++ jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c 2018-07-30 16:13:19.116935000 +0200 @@ -330,11 +330,11 @@ break; case SCTP_ADDR_MADE_PRIM : event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_MADE_PRIM; -#ifdef __linux__ /* Solaris currently doesn't support SCTP_ADDR_CONFIRMED */ +#ifndef __solaris__ /* Solaris currently doesn't support SCTP_ADDR_CONFIRMED */ break; case SCTP_ADDR_CONFIRMED : event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_CONFIRMED; -#endif /* __linux__ */ +#endif /* __solaris__ */ } addressObj = SockAddrToInetSocketAddress(env, (struct sockaddr*)&spc->spc_aaddr); @@ -445,13 +445,13 @@ } else if (errno == EINTR) { return IOS_INTERRUPTED; -#ifdef __linux__ +#ifndef __solaris__ } else if (errno == ENOTCONN) { /* ENOTCONN when EOF reached */ rv = 0; /* there will be no control data */ msg->msg_controllen = 0; -#endif /* __linux__ */ +#endif /* __solaris__ */ } else { handleSocketError(env, errno); @@ -568,7 +568,7 @@ /* Set up the msghdr structure for sending */ memset(msg, 0, sizeof (*msg)); memset(cbuf, 0, cbuf_size); - msg->msg_name = &sa; + msg->msg_name = (sa_len == 0 ? NULL : &sa); msg->msg_namelen = sa_len; iov->iov_base = addr; iov->iov_len = length; [-- Attachment #2 --] 0 *H 010 + 0 *H 00 %ف0 *H 010 UDE1+0)U "T-Systems Enterprise Services GmbH10UT-Systems Trust Center1%0#UT-TeleSec GlobalRoot Class 20 160222133822Z 310222235959Z010 UDE1E0CU <Verein zur Foerderung eines Deutschen Forschungsnetzes e. V.10UDFN-PKI1-0+U$DFN-Verein Certification Authority 20"0 *H 0 `fAsMg9Z`GNWKVlUvFEc>pԫT#7( ]Ę7 fxJ2)y T_Jx4twMYZ/l<
