The SCTP channel factory methods, namely SctpChannel::open, SctpServerChannel::open, and SctpMultiChannel::open, are specified to throw UnsupportedOperationException, if the SCTP protocol is not supported. Currently, underlying platform support is assumed once the appropriate libsctp.so.1 library is present (along with its supported interface functions). This may not always be the case, e.g. if the Linux sctp kernel module is not present or loaded. In which case a SocketException is thrown.
It would be more appropriate to check for EPROTONOSUPPORT and ESOCKTNOSUPPORT, and throw UOE rather than SE. The existing java/net/SctpSanity.java tests already covers this case, when run on platforms without support. ------------- Commit messages: - Initial changes Changes: https://git.openjdk.java.net/jdk/pull/4246/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4246&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8267938 Stats: 8 lines in 1 file changed: 6 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/4246.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4246/head:pull/4246 PR: https://git.openjdk.java.net/jdk/pull/4246