Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8267938

(sctp) SCTP channel factory methods should check platform support

    XMLWordPrintable

Details

    • b25
    • linux

    Backports

      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.

        Attachments

          Issue Links

            Activity

              People

                chegar Chris Hegarty
                chegar Chris Hegarty
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: