JDK-7041200 : java.net.InterfaceAddress's equals method may throw NPE
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 6
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-05-02
  • Updated: 2011-09-08
  • Resolved: 2011-05-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
6u26-rev b22Fixed
Related Reports
Relates :  
InterfaceAddress.equals contains this:

if ((address != null & cmp.address == null) ||
    return false;
if ((broadcast != null & cmp.broadcast == null) ||
    return false;

if address == null, or broadcast == null, NPE will be thrown.  broadcast ==
null can be tested by running this test:

try {
   Enumeration<NetworkInterface> networkInterfaces =

   while (networkInterfaces.hasMoreElements()) {
      NetworkInterface networkInterface = networkInterfaces.nextElement();

      List<InterfaceAddress> interfaceAddresses =

      for (InterfaceAddress interfaceAddress : interfaceAddresses) {
} catch (SocketException ex) {

When the loopback interface address is reached, NPE will be thrown for the
broadcast test.  I'm not sure if you can get an interface address with a null

This has been fixed in JDK 7.

EVALUATION Appears to be a dup of 6628576.