File tree 1 file changed +14
-11
lines changed
1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -360,17 +360,20 @@ public static List<InetAddress> getAddressesWithSymbolicAndNumericScopes() {
360
360
// which are incompatible with native Windows routines.
361
361
// So on Windows test only addresses with numeric scope.
362
362
// On other platforms test both symbolic and numeric scopes.
363
- conf .ip6Addresses ().forEach (addr6 -> {
364
- try {
365
- result .add (Inet6Address .getByAddress (null , addr6 .getAddress (), addr6 .getScopeId ()));
366
- } catch (UnknownHostException e ) {
367
- // cannot happen!
368
- throw new RuntimeException ("Unexpected" , e );
369
- }
370
- if (!Platform .isWindows ()) {
371
- result .add (addr6 );
372
- }
373
- });
363
+ conf .ip6Addresses ()
364
+ // test only IPv6 loopback and link-local addresses (JDK-8224775)
365
+ .filter (addr -> addr .isLinkLocalAddress () || addr .isLoopbackAddress ())
366
+ .forEach (addr6 -> {
367
+ try {
368
+ result .add (Inet6Address .getByAddress (null , addr6 .getAddress (), addr6 .getScopeId ()));
369
+ } catch (UnknownHostException e ) {
370
+ // cannot happen!
371
+ throw new RuntimeException ("Unexpected" , e );
372
+ }
373
+ if (!Platform .isWindows ()) {
374
+ result .add (addr6 );
375
+ }
376
+ });
374
377
} catch (IOException e ) {
375
378
// cannot happen!
376
379
throw new RuntimeException ("Unexpected" , e );
You can’t perform that action at this time.
0 commit comments