8386595: Two java/net/MulticastSocket tests fail on machines with no ipv6 address other than loopback

Reviewed-by: jpai
This commit is contained in:
Arno Zeller 2026-07-20 01:39:07 +00:00 committed by Jaikiran Pai
parent e487b0dd02
commit 2ac4a2db14
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -56,7 +56,7 @@ public class NoLoopbackPackets {
}
NetworkConfiguration nc = NetworkConfiguration.probe();
if (IPSupport.hasIPv6() && nc.hasTestableIPv6Address()) {
if (IPSupport.hasIPv6() && nc.ip6MulticastInterfaces().findAny().isPresent()) {
groups.add(new InetSocketAddress(InetAddress.getByName("::ffff:224.1.1.2"), port));
groups.add(new InetSocketAddress(InetAddress.getByName("ff02::1:1"), port));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -141,7 +141,7 @@ public class Test {
doTest("224.80.80.80");
// If IPv6 is enabled perform multicast tests with various scopes
if (nc.hasTestableIPv6Address()) {
if (nc.ip6MulticastInterfaces().findAny().isPresent()) {
doTest("ff01::a");
}