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

getNetworkPrefixLength() does not return correct prefix length

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 7
    • core-libs
    • x86
    • linux

      In Ipv4 environment, the result of InterfaceAddress.getNetworkPrefixLength() for network interface
      which does not have broadcast flag(ex. loopback address) is always 0.

      Correct prefix length should be returns even in the above situation.

      CONFIGURATION:
      JDK: jdk7/jdk6u27
      OS : linux(generic)

      REPRODUCE:
      1. Compile the attached test case
      2. launch
        "java GetBrodCastAddrAndPrefixLen <interface name>"
       
      ex.
      ---
      $ java GetBrodCastAddrAndPrefixLen lo
      <0:0:0:0:0:0:0:1%1>
      getBroadcast():null
      getNetworkPrefixLength():128
      <127.0.0.1>
      getBroadcast():null
      getNetworkPrefixLength():0
      ---

      The last line of result should not be 0.

            Unassigned Unassigned
            tbaba Tadayuki Baba (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: