< prev index next >

test/jdk/java/nio/channels/DatagramChannel/Promiscuous.java

Print this page
rev 59105 : imported patch corelibs


 206             int major = Integer.parseInt(vers[0]);
 207             if (major < 3) {
 208                 System.out.format("Kernel version is %s, test skipped%n", osversion);
 209                 return;
 210             }
 211         }
 212 
 213         // get local network configuration to use
 214         NetworkConfiguration config = NetworkConfiguration.probe();
 215 
 216         // multicast groups used for the test
 217         InetAddress ip4Group1 = InetAddress.getByName("225.4.5.6");
 218         InetAddress ip4Group2 = InetAddress.getByName("225.4.6.6");
 219 
 220         for (NetworkInterface nif: config.ip4MulticastInterfaces()
 221                                          .collect(Collectors.toList())) {
 222             InetAddress source = config.ip4Addresses(nif).iterator().next();
 223             test(INET, nif, ip4Group1, ip4Group2);
 224 
 225             // Solaris and Linux allow IPv6 sockets join IPv4 multicast groups
 226             if (os.equals("SunOS") || os.equals("Linux"))
 227                 test(UNSPEC, nif, ip4Group1, ip4Group2);
 228         }
 229     }
 230 }


 206             int major = Integer.parseInt(vers[0]);
 207             if (major < 3) {
 208                 System.out.format("Kernel version is %s, test skipped%n", osversion);
 209                 return;
 210             }
 211         }
 212 
 213         // get local network configuration to use
 214         NetworkConfiguration config = NetworkConfiguration.probe();
 215 
 216         // multicast groups used for the test
 217         InetAddress ip4Group1 = InetAddress.getByName("225.4.5.6");
 218         InetAddress ip4Group2 = InetAddress.getByName("225.4.6.6");
 219 
 220         for (NetworkInterface nif: config.ip4MulticastInterfaces()
 221                                          .collect(Collectors.toList())) {
 222             InetAddress source = config.ip4Addresses(nif).iterator().next();
 223             test(INET, nif, ip4Group1, ip4Group2);
 224 
 225             // Solaris and Linux allow IPv6 sockets join IPv4 multicast groups
 226             if (os.equals("Linux"))
 227                 test(UNSPEC, nif, ip4Group1, ip4Group2);
 228         }
 229     }
 230 }
< prev index next >