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

Inet6Address.getHostName() should not include scope id for global addresses

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs
    • x86
    • linux

      FULL PRODUCT VERSION :
      java version "1.5.0_06"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
      Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Linux mach 2.6.15-26-386 #1 PREEMPT Fri Jul 7 19:27:00 UTC 2006 i686 GNU/Linux

      and basically all others, judging by the Inet6Address source code.

      A DESCRIPTION OF THE PROBLEM :
      In the javadoc section entitled "Textual representation of IPv6 scoped addresses" for java.net.Inet6Address, it is stated that the use of scope IDs follows draft-ietf-ipngwg-scoping-arch-04.txt.

      In section 12.1 of draft-ietf-ipngwg-scoping-arch-04.txt it is stated

      "12.1 Non-Global Addresses

      The format applies to all kinds of unicast and multicast addresses of
      non-global scope except the unspecified address, which does not have a
      scope. The format is meaningless and should not be used for global
      addresses. "

      Yet, if one does a getHostName() on a global Inet6Address, one gets something like

      2001:4840:ffff:fffe:211:24ff:fea5:d2c8%0

      My reading of the section 12.1 of the IETF draft suggests that the scope ID should not be present on this textual representation. Moreover, the same language is used in Section 11.1 of RFC 4007 http://www.ietf.org/rfc/rfc4007.txt, which is the standards-track version of this draft.

      In closing, I would consider the scope ID on global IPv6 addresses a bug.

      REPRODUCIBILITY :
      This bug can be reproduced always.

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: