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

java 1.4.x and 1.5.x create java.net.ServerSocket per default in AF_INET6 when inet6 interface is up

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_9

      Description


      java 1.4.x and 1.5.x create java.net.ServerSocket per default in AF_INET6
      when inet6 interface is up. Java 1.2.2 and 1.3.1 do not.

      The problem is strictly reproducible.

      0. Precondition
      ---------------
       Please make sure that inet6 interface is up:
      % ifconfig -a
      lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
              inet 127.0.0.1 netmask ff000000
      eri0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
              inet 129.157.133.192 netmask ffffff00 broadcast 129.157.133.255
      eri0: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2
              inet6 fe80::203:baff:fe5b:7e89/10

       If inet6 interface is not up, use:
      # ifconfig eri0 inet6 plumb up


      1. Testcase
      -----------
       Please find attached the following files.
      -rwxr-xr-x 1 tl15687 sun 343788 Feb 2 09:24 test1
      -rw-r--r-- 1 tl15687 sun 988 Feb 2 09:24 test1.cc
      -rw-r--r-- 1 tl15687 sun 864 Feb 2 09:24 testserver.class
      -rw-r--r-- 1 tl15687 sun 417 Feb 2 09:24 testserver.java


      2. Run testcase on 1.4.2_07
      ---------------------------
      % /j2sdk1.4.2_07/bin/java -version
      java version "1.4.2_07"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_07-b05)
      Java HotSpot(TM) Client VM (build 1.4.2_07-b05, mixed mode)
      % /j2sdk1.4.2_07/bin/java testserver &
      [1] 25559
      % netstat -a -f inet | grep 3300
            *.3300 *.* 0 0 49152 0 LISTEN
      % netstat -a -f inet6 | grep 3300
            *.3300 *.* 0 0 49152 0 LISTEN
      % ./test1&
      [2] 25564
      % netstat -a -f inet | grep 3300
            *.3300 *.* 0 0 49152 0 LISTEN
            *.3300 *.* 0 0 49152 0 LISTEN
      % netstat -a -f inet6 | grep 3300
            *.3300 *.* 0 0 49152 0 LISTEN
      % kill -HUP 25559
      %
       "test1" is able to access a socket at address 3300 in family "inet".


      3. Run testcase on 1.5.0
      ------------------------
      % /jdk1.5.0_01/bin/java -version
      java version "1.5.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
      Java HotSpot(TM) Server VM (build 1.5.0_01-b08, mixed mode)
      % /jdk1.5.0_01/bin/java testserver &
      [1] 3330
      % netstat -a -f inet | grep 3300
            *.3300 *.* 0 0 49152 0 LISTEN
      % netstat -a -f inet6 | grep 3300
            *.3300 *.* 0 0 49152 0 LISTEN
      % ./test1 &
      [2] 3337
      % netstat -a -f inet | grep 3300
            *.3300 *.* 0 0 49152 0 LISTEN
            *.3300 *.* 0 0 49152 0 LISTEN
      % netstat -a -f inet6 | grep 3300
            *.3300 *.* 0 0 49152 0 LISTEN
      % kill -HUP 3330
      %
       Same behaviour as with 1.4.2_07


      4. Compare behaviour w/ 1.3.1_15
      --------------------------------
      % /j2sdk1_3_1_15/bin/java testserver &
      [1] 25584
      % netstat -a -f inet | grep 3300
            *.3300 *.* 0 0 49152 0 LISTEN
      % netstat -a -f inet6 | grep 3300
      % ./test1&
      First: bind call failure
      % kill -HUP 25584
      %
       "test1" is unable to access a socket at address 3300 in family "inet".

      5. Compare behaviour w/ 1.2.2
      -----------------------------
      % /usr/java1.2/bin/java -version
      java version "1.2.2"
      Solaris VM (build Solaris_JDK_1.2.2_13, native threads, sunwjit)
      % /usr/java1.2/bin/java testserver &
      [1] 25621
      % netstat -a -f inet | grep 3300
            *.3300 *.* 0 0 49152 0 LISTEN
      % netstat -a -f inet6 | grep 3300
      % test1
      First: bind call failure
      % kill -HUP 25621
      %


      ###@###.### 2005-2-02 13:25:35 GMT

        Attachments

          Activity

            People

            • Assignee:
              jccollet Jean-Christophe Collet (Inactive)
              Reporter:
              thlenz Thomas Lenz (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: