From 2ac4a2db146be58fd8d82b6882af62013bb4a6b9 Mon Sep 17 00:00:00 2001 From: Arno Zeller Date: Mon, 20 Jul 2026 01:39:07 +0000 Subject: [PATCH] 8386595: Two java/net/MulticastSocket tests fail on machines with no ipv6 address other than loopback Reviewed-by: jpai --- test/jdk/java/net/MulticastSocket/NoLoopbackPackets.java | 4 ++-- test/jdk/java/net/MulticastSocket/Test.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/jdk/java/net/MulticastSocket/NoLoopbackPackets.java b/test/jdk/java/net/MulticastSocket/NoLoopbackPackets.java index 36b6f12413d..73fd505845a 100644 --- a/test/jdk/java/net/MulticastSocket/NoLoopbackPackets.java +++ b/test/jdk/java/net/MulticastSocket/NoLoopbackPackets.java @@ -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)); } diff --git a/test/jdk/java/net/MulticastSocket/Test.java b/test/jdk/java/net/MulticastSocket/Test.java index 01dd82ece75..633a2a4e9a8 100644 --- a/test/jdk/java/net/MulticastSocket/Test.java +++ b/test/jdk/java/net/MulticastSocket/Test.java @@ -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"); }