JDK-8304286 : java/net/SocketOption/OptionsTest.java failing after JDK-8302659
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 21
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-03-15
  • Updated: 2023-03-27
  • Resolved: 2023-03-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21 b15Fixed
Related Reports
Relates :  
Sub Tasks
JDK-8304287 :  
Description
The test selects the first interface for which supportsMulticast returns true, and tries to use it with setOption(IP_MULTICAST_IF). This used to work on Windows because loopback was always returned as the first interface; now the interface order is different, and the first interface might no longer support multicasting, usually because it's a filter interface with no IP addresses assigned.

JDK-8302659 modified the test to only use interfaces with non-empty list of addresses in addition to supporting multicast. This worked well on Windows and Mac, but failed on Linux with the following security manager policy:
    permission java.net.SocketPermission "localhost:*", "connect, accept, listen, resolve";

this is because the loopback interface does not support multicasting on Linux, and all other interfaces had their addresses filtered out by the security manager.

We need a way to select an interface on Windows that would be usable with IP_MULTICAST_IF. One option to explore is returning false from supportsMulticast on filter interfaces.
Comments
Changeset: eda00651 Author: Daniel JeliƄski <djelinski@openjdk.org> Date: 2023-03-22 08:42:39 +0000 URL: https://git.openjdk.org/jdk/commit/eda006510792de75d898cd66eeb86a00ad2fd45a
22-03-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13061 Date: 2023-03-16 14:19:14 +0000
16-03-2023