Details
-
Bug
-
Status: Resolved
-
P3
-
Resolution: Fixed
-
11.0.11, 16
-
b25
-
linux
Description
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. For example,
$ jshell
| Welcome to JShell -- Version 11.0.11
| For an introduction type: /help intro
jshell> com.sun.nio.sctp.SctpChannel.open()
| Exception java.net.SocketException: Protocol not supported
| at SctpNet.socket0 (Native Method)
| at SctpNet.socket (SctpNet.java:85)
| at SctpChannelImpl.<init> (SctpChannelImpl.java:137)
| at SctpChannel.open (SctpChannel.java:170)
| at (#1:1)
It would be more appropriate to check for EPROTONOSUPPORT and ESOCKTNOSUPPORT, and throw UOE rather than SE.
$ jshell
| Welcome to JShell -- Version 11.0.11
| For an introduction type: /help intro
jshell> com.sun.nio.sctp.SctpChannel.open()
| Exception java.net.SocketException: Protocol not supported
| at SctpNet.socket0 (Native Method)
| at SctpNet.socket (SctpNet.java:85)
| at SctpChannelImpl.<init> (SctpChannelImpl.java:137)
| at SctpChannel.open (SctpChannel.java:170)
| at (#1:1)
It would be more appropriate to check for EPROTONOSUPPORT and ESOCKTNOSUPPORT, and throw UOE rather than SE.
Attachments
Issue Links
- duplicates
-
JDK-8267353 java/net/SctpSanity.java fails due to Protocol not supported
-
- Resolved
-