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

The logic of java/net/ipv6tests/TcpTest.java is flawed

    XMLWordPrintable

Details

    • b11
    • generic
    • generic

    Backports

      Description

        This test creates a server socket and binds it to an IPv4 address.
        Then it connects a Socket to that address & port and expects it to succeed.
        Then it tries to connect a Socket using the machine's IPv6 address and expects it to fail, since the server is bound to the IPv4 only.
        But nothing prevents something else to be listening by chance on that address, so connecting to IPv6 is not *guaranteed* to fail... We would need to fail only if the server we connected to was *our* server.

        As a result this test sometimes fails with the following exception:

        java.lang.RuntimeException: connect to IPv6 address should be refused
        at TcpTest.test2(TcpTest.java:136)
        at TcpTest.main(TcpTest.java:76)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:565)
        at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
        at java.base/java.lang.Thread.run(Thread.java:830)

        Attachments

          Issue Links

            Activity

              People

                pconcannon Patrick Concannon (Inactive)
                dfuchs Daniel Fuchs
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: