Skip site navigation (1)Skip section navigation (2)
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 GmbH10UT-Systems Trust Center1%0#UT-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 fxJ2)y T_Jx4twMYZ/l<5e
2mZjKb84YE6Ixjm[k<q;gz6N)=Q\4
u9i%=+;U*^3	1FkYt0p0U0U2&JJK0U#0Y 6y"kaҸ,˂J0U003U ,0*0
+!,0
+!,0g0LUE0C0A?=;http://pki0336.telesec.de/rl/TeleSec_GlobalRoot_Class_2.crl0+z0x0,+0 http://ocsp0336.telesec.de/ocspr0H+0<http://pki0336.telesec.de/crt/TeleSec_GlobalRoot_Class_2.cer0
	*H
>eV-;qOں)!F.8y8tv]bL3j2,LG`Utk,ykMPf0"rM>[ϙR9.D~i;u;"lGG4}=wMOY>GJXoB.M<I&6,"͋xU;DRiТSW{$Jer900c,=0
	*H
010	UDE1E0CU
<Verein zur Foerderung eines Deutschen Forschungsnetzes e. V.10UDFN-PKI1-0+U$DFN-Verein Certification Authority 20
160524113840Z
310222235959Z010	UDE1E0CU
<Verein zur Foerderung eines Deutschen Forschungsnetzes e. V.10UDFN-PKI1%0#UDFN-Verein Global Issuing CA0"0
	*H
0
;yGi9٢0r)_KhLk{-n:WQ6pmc.@уLf=di囤rh9QyӮ/]cqK9zBi@p翞MGH_e*I-?T/:W~xJA}S_ȳ*0$?MR6$eǖs$hYv~
x<K7S:8Gmd=<ZEJʀ|LL00U00U0)U "0 0
+!,0
+!,0Uk:S୲2	;t0U#02&JJK0U00@><:http://cdp1.pca.dfn.de/global-root-g2-ca/pub/crl/cacrl.crl0@><:http://cdp2.pca.dfn.de/global-root-g2-ca/pub/crl/cacrl.crl0+003+0'http://ocsp.pca.dfn.de/OCSP-Server/OCSP0J+0>http://cdp1.pca.dfn.de/global-root-g2-ca/pub/cacert/cacert.crt0J+0>http://cdp2.pca.dfn.de/global-root-g2-ca/pub/cacert/cacert.crt0
	*H
xENU	j>xh5?k8w,>̨͠3$b6LxnPn`OR1CFubnfQB1gPI9˟ʆHK+f8W-L_>\)9l{F8ܰ?q3Hc%%<z{Wn8︠/[Kl=w3Sv&%Ao/|~`]AaI)ب-uJU4"00Πv0
	*H
010	UDE1E0CU
<Verein zur Foerderung eines Deutschen Forschungsnetzes e. V.10UDFN-PKI1%0#UDFN-Verein Global Issuing CA0
170710101820Z
200709101820Z0z10	UDE1 0U
Fachhochschule Muenster1200U)Fachbereich Elektrotechnik und Informatik10UTimo Voelker0"0
	*H
0
.xNhZ\ˌ29aR7pv@|dw{((ӌ8E%8"ŀu_CSYᤃͭ+V\*ûԿo(2͵-EҧPPK#$ӽ&-QuT5hȂ-پ6;=5	 <<k.c9ggbUuH7rz,:J'@rţcEWyE.=V0R0@U 9070+!,0+!,0
+!,0	U00U0U%0++0U㉯ToLs(/ygKM0U#0k:S୲2	;t0&U0timo.voelker@fh-muenster.de0U00?=;9http://cdp1.pca.dfn.de/dfn-ca-global-g2/pub/crl/cacrl.crl0?=;9http://cdp2.pca.dfn.de/dfn-ca-global-g2/pub/crl/cacrl.crl0+003+0'http://ocsp.pca.dfn.de/OCSP-Server/OCSP0I+0=http://cdp1.pca.dfn.de/dfn-ca-global-g2/pub/cacert/cacert.crt0I+0=http://cdp2.pca.dfn.de/dfn-ca-global-g2/pub/cacert/cacert.crt0
	*H
FߋFBM7DNs{Ihu1@;{K&f'c{=,0h-:i)WXK[k>R*˥0).gD{YP[Dzw$lp',tz!!sq|mr|\HL юFPRFXDѭAlt.CKB0U@cG?$
Z-ea?|a1qſr+ʉIq100010	UDE1E0CU
<Verein zur Foerderung eines Deutschen Forschungsnetzes e. V.10UDFN-PKI1%0#UDFN-Verein Global Issuing CAv0	+0	*H
	1	*H
0	*H
	1
180731135500Z0#	*H
	1g~IFu.5X
<~z#0	+710010	UDE1E0CU
<Verein zur Foerderung eines Deutschen Forschungsnetzes e. V.10UDFN-PKI1%0#UDFN-Verein Global Issuing CAv0*H
	1010	UDE1E0CU
<Verein zur Foerderung eines Deutschen Forschungsnetzes e. V.10UDFN-PKI1%0#UDFN-Verein Global Issuing CAv0
	*H
4(fmǗU|>]:=G5QGoрJ)&oikP\6(R.ɴ_ff]E®CCw:.˲!waz9S7AVgHKR:N!(-ޡ`&ڰE.F`준ۂTmHԞ[.r+¶b'w@J݇$C$((L@Ey{:2nh`Ip'7፡v}e"S1r

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FD5A4D7B-42E6-4239-80BF-886876AE58DB>