glassfish
  1. glassfish
  2. GLASSFISH-19428

com.sun.appserv.iiop.endpoints does not support IPV6

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0_b84_RC1
    • Component/s: orb
    • Labels:
      None
    • Environment:

      windows

      Description

      because the IPV6 address contains ":",so when the value of "com.sun.appserv.iiop.endpoints" contains IPV6 address,the following code which is marked ★ can not get the correct ip and port

      Directory: orb\orb-iiop\src\main\java\
      Package: org.glassfish.enterprise.iiop.impl
      Class:RoundRobinPolicy
      
      private ClusterInstanceInfo makeClusterInstanceInfo(String str, 
          int weight) {
      
          String[] host_port = str.split(":");  ★
          String server_identifier = ""; //for bootstrapping, can be ""
          String type = CLEAR_TEXT; //will be clear_text for bootstrapping
          SocketInfo socketInfo = new SocketInfo(
              type, host_port[0], Integer.parseInt( host_port[1]) );
          List<SocketInfo> sil = new ArrayList<SocketInfo>(1) ;
          sil.add( socketInfo ) ;
      
          return new ClusterInstanceInfo(server_identifier, weight, sil);
      }
      

        Activity

        Hide
        shreedhar_ganapathy added a comment -

        Reassigning to Orb component

        Show
        shreedhar_ganapathy added a comment - Reassigning to Orb component
        Hide
        Harshad Vilekar added a comment -

        Colon ( characters in IPv6 address conflicts with the established syntax - where the colon is used to terminate the host path before a port number. This works with literal ipv4 address. Update host:port string parsing to support literal IPv6 address.

        Show
        Harshad Vilekar added a comment - Colon ( characters in IPv6 address conflicts with the established syntax - where the colon is used to terminate the host path before a port number. This works with literal ipv4 address. Update host:port string parsing to support literal IPv6 address.
        Hide
        lzg5039 added a comment -

        Harshad Vilekar:
        Thanks for you to help me to fix this bug. Can I create a fix for the bug, and someone help me to review it in the future?

        Show
        lzg5039 added a comment - Harshad Vilekar: Thanks for you to help me to fix this bug. Can I create a fix for the bug, and someone help me to review it in the future?
        Hide
        Harshad Vilekar added a comment -

        linzhengguo: Yes, please test your fix with:

        1. literal ipv6 format address,
        2. literal ipv4 address, and
        3. regular hostname.

        Then attach the file diff for review.

        Show
        Harshad Vilekar added a comment - linzhengguo: Yes, please test your fix with: 1. literal ipv6 format address, 2. literal ipv4 address, and 3. regular hostname. Then attach the file diff for review.
        Hide
        lzg5039 added a comment -

        Harshad Vilekar:
        I hava done the following tests, and set address by "com.sun.appserv.iiop.endpoints"
        >1. literal ipv6 format address,
        Test OK
        >2. literal ipv4 address, and
        Test OK
        >3. regular hostname.
        Test OK
        >4. ipv6 mix with ipv4
        Test OK

        Show
        lzg5039 added a comment - Harshad Vilekar: I hava done the following tests, and set address by "com.sun.appserv.iiop.endpoints" >1. literal ipv6 format address, Test OK >2. literal ipv4 address, and Test OK >3. regular hostname. Test OK >4. ipv6 mix with ipv4 Test OK
        Hide
        lzg5039 added a comment - - edited

        Harshad Vilekar:
        My fix as follows,you also can the attach file

         
        Directory: orb\orb-iiop\src\main\java\
        Package: org.glassfish.enterprise.iiop.impl
        Class:RoundRobinPolicy
        
        private ClusterInstanceInfo makeClusterInstanceInfo(String str, 
            int weight) {
        -   String[] host_port = str.split(":");//delete this code
        
            //support IPV6 begin add the following code
        +   String[] host_port = new String[2];
        +   int i = str.lastIndexOf(':');
        +   host_port[0] = str.substring(0,i);
        +   host_port[1] = str.substring(i+1);
            //support IPV6 end
        
            String server_identifier = ""; //for bootstrapping, can be ""
            String type = CLEAR_TEXT; //will be clear_text for bootstrapping
            SocketInfo socketInfo = new SocketInfo(
                type, host_port[0], Integer.parseInt( host_port[1]) );
            List<SocketInfo> sil = new ArrayList<SocketInfo>(1) ;
            sil.add( socketInfo ) ;
        
            return new ClusterInstanceInfo(server_identifier, weight, sil);
        }
        
        Show
        lzg5039 added a comment - - edited Harshad Vilekar: My fix as follows,you also can the attach file Directory: orb\orb-iiop\src\main\java\ Package: org.glassfish.enterprise.iiop.impl Class:RoundRobinPolicy private ClusterInstanceInfo makeClusterInstanceInfo(String str, int weight) { - String[] host_port = str.split(":");//delete this code //support IPV6 begin add the following code + String[] host_port = new String[2]; + int i = str.lastIndexOf(':'); + host_port[0] = str.substring(0,i); + host_port[1] = str.substring(i+1); //support IPV6 end String server_identifier = ""; //for bootstrapping, can be "" String type = CLEAR_TEXT; //will be clear_text for bootstrapping SocketInfo socketInfo = new SocketInfo( type, host_port[0], Integer.parseInt( host_port[1]) ); List<SocketInfo> sil = new ArrayList<SocketInfo>(1) ; sil.add( socketInfo ) ; return new ClusterInstanceInfo(server_identifier, weight, sil); }
        Hide
        Harshad Vilekar added a comment -
        • What is the impact on the customer of the bug? Support literal ipv6 address in IIOP endpoint list.
        • How likely is it that a customer will see the bug and how serious is the bug? Only when using ipv6 addresses, rather than host names.
        • Is it a regression? Does it meet other bug fix criteria (security, performance, etc.)? Not a regression.
        • What CTS failures are caused by this bug? No CTS failures.
        • What is the cost/risk of fixing the bug? Fix is ready, under regression test.
        • How risky is the fix? How much work is the fix? Is the fix complicated? Fix is isolated. Not very complex.
        • Is there an impact on documentation or message strings? No.
        • Which tests should QA (re)run to verify the fix did not destabilize GlassFish? Cluster Tests with Remote EJB Apps.
        • Which is the targeted build of 4.0 for this fix? b84
        • Is this an integration of a new version of a component from another project ? No
        Show
        Harshad Vilekar added a comment - What is the impact on the customer of the bug? Support literal ipv6 address in IIOP endpoint list. How likely is it that a customer will see the bug and how serious is the bug? Only when using ipv6 addresses, rather than host names. Is it a regression? Does it meet other bug fix criteria (security, performance, etc.)? Not a regression. What CTS failures are caused by this bug? No CTS failures. What is the cost/risk of fixing the bug? Fix is ready, under regression test. How risky is the fix? How much work is the fix? Is the fix complicated? Fix is isolated. Not very complex. Is there an impact on documentation or message strings? No. Which tests should QA (re)run to verify the fix did not destabilize GlassFish? Cluster Tests with Remote EJB Apps. Which is the targeted build of 4.0 for this fix? b84 Is this an integration of a new version of a component from another project ? No
        Hide
        Tom Mueller added a comment -

        Approved for 4.0. Please update the fix version field to the correct build.

        Show
        Tom Mueller added a comment - Approved for 4.0. Please update the fix version field to the correct build.
        Hide
        Harshad Vilekar added a comment -

        Reviewed and Committed the fix suggested by lzg5039. svn revision #61237.

        Show
        Harshad Vilekar added a comment - Reviewed and Committed the fix suggested by lzg5039. svn revision #61237.

          People

          • Assignee:
            Harshad Vilekar
            Reporter:
            lzg5039
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: