JDK-7123114 : InterfaceAddress.getNetworkPrefixLength() returns -1 for wifi adapter
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86
  • Submitted: 2011-12-20
  • Updated: 2012-09-06
  • Resolved: 2011-12-29
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) Client VM (build 22.0-b10, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7600]

EXTRA RELEVANT SYSTEM CONFIGURATION :
Wireless LAN adapter Wireless Network Connection:
   Link-local IPv6 Address . . . . . : fe80::223:14ff:fe69:c0b0%17
   IPv4 Address. . . . . . . . . . . : 192.168.11.8
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.11.1

(name:net6 (Intel(R) Centrino(R) Advanced-N 6200 AGN) in java)

A DESCRIPTION OF THE PROBLEM :
InterfaceAddress.toString() for the wifi adapter gives:
/192.168.11.8/-1 [/25.42.182.0]
where the -1 is so wrong.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Take a Dell laptop with matching Wifi adapter and list interface addresses. I suppose this is not related to network config as it happens also with similar laptop in another wifi.


REPRODUCIBILITY :
This bug can be reproduced always.