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

getNetworkInterfaces => No such device or address on Solaris 8 if no IPv6

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • core-libs
    • beta
    • generic, x86, sparc
    • solaris_8


      The following test case fails on Solaris 8 if IPv6 is not enabled (okay if
      IPv6 enabled).

      Exception in thread "main" java.net.SocketException: No such device or address
              at java.net.NetworkInterface.getAll(Native Method)
              at java.net.NetworkInterface.getNetworkInterfaces(NetworkInterface.java:158)
              at ni.main(ni.java:7)


      import java.net.*;
      import java.util.*;

      public class ni {

          public static void main(String args[]) throws Exception {
              Enumeration niEnum = NetworkInterface.getNetworkInterfaces();

              while (niEnum.hasMoreElements()) {
                  NetworkInterface ni = (NetworkInterface)niEnum.nextElement();
                  System.out.println(ni);
              }
          }

      }

            alanb Alan Bateman
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: