Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8221681 Improved IPv6 Support
  3. JDK-8293842

IPv6-only systems throws UnsupportedOperationException for several socket/TCP options

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • P4
    • 20
    • None
    • core-libs
    • None
    • b16

    Description

      A few places in native code tries to create a socket with PF_INET, then check if a socket or TCP option is supported. E.g. in LinuxSocketOptions.c:

      static jint socketOptionSupported(jint level, jint optname) {
          jint one = 1;
          jint rv, s;
          socklen_t sz = sizeof (one);
          s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
          if (s < 0) {
              return 0;
          }
          rv = getsockopt(s, level, optname, (void *) &one, &sz);
          ...
      }

      On systems that only supports IPv6, the socket(PF_INET, ...) call fails, and it will incorrectly report those options are unsupported. Affected options include: SO_REUSEPORT, TCP_KEEPIDLE, TCP_KEEPCNT, TCP_QUICKACK.

      Attachments

        Issue Links

          Activity

            People

              manc Man Cao
              manc Man Cao
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: