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

getNetworkPrefixLength() does not return correct prefix length

XMLWordPrintable

    • b94
    • x86
    • linux, windows_7
    • Verified

      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.

            chegar Chris Hegarty
            tbaba Tadayuki Baba (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: