8238376: test/jdk/java/nio/channels/DatagramChannel/Loopback.java failing on multi-homed systems
Reviewed-by: dfuchs
This commit is contained in:
parent
8c0fab8fbe
commit
c23d1de2f8
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -45,7 +45,9 @@ import java.nio.channels.SelectionKey;
|
|||||||
import java.nio.channels.Selector;
|
import java.nio.channels.Selector;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import static java.net.StandardProtocolFamily.*;
|
import static java.net.StandardProtocolFamily.INET;
|
||||||
|
import static java.net.StandardProtocolFamily.INET6;
|
||||||
|
import static java.net.StandardSocketOptions.IP_MULTICAST_IF;
|
||||||
import static java.net.StandardSocketOptions.IP_MULTICAST_LOOP;
|
import static java.net.StandardSocketOptions.IP_MULTICAST_LOOP;
|
||||||
|
|
||||||
import jdk.test.lib.NetworkConfiguration;
|
import jdk.test.lib.NetworkConfiguration;
|
||||||
@ -106,6 +108,9 @@ public class Loopback {
|
|||||||
System.out.format("join %s @ %s%n", group.getHostAddress(), ni.getName());
|
System.out.format("join %s @ %s%n", group.getHostAddress(), ni.getName());
|
||||||
dc.join(group, ni);
|
dc.join(group, ni);
|
||||||
|
|
||||||
|
System.out.format("set outgoing multicast interface to %s%n", ni.getName());
|
||||||
|
dc.setOption(IP_MULTICAST_IF, ni);
|
||||||
|
|
||||||
// -- IP_MULTICAST_LOOP enabled --
|
// -- IP_MULTICAST_LOOP enabled --
|
||||||
|
|
||||||
assertTrue(dc.getOption(IP_MULTICAST_LOOP), "IP_MULTICAST_LOOP not enabled");
|
assertTrue(dc.getOption(IP_MULTICAST_LOOP), "IP_MULTICAST_LOOP not enabled");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user