Skip to content
Permalink
Browse files

8238376: test/jdk/java/nio/channels/DatagramChannel/Loopback.java fai…

…ling on multi-homed systems

Reviewed-by: dfuchs
  • Loading branch information
Alan Bateman
Alan Bateman committed Feb 10, 2020
1 parent 8c0fab8 commit c23d1de2f8b58e8e81a46b4f7099eb88cbb28f2d
Showing with 7 additions and 2 deletions.
  1. +7 −2 test/jdk/java/nio/channels/DatagramChannel/Loopback.java
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,9 @@
import java.nio.channels.Selector;
import java.util.List;
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 jdk.test.lib.NetworkConfiguration;
@@ -106,6 +108,9 @@ static void test(ProtocolFamily family, InetAddress group, NetworkInterface ni)
System.out.format("join %s @ %s%n", group.getHostAddress(), ni.getName());
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 --

assertTrue(dc.getOption(IP_MULTICAST_LOOP), "IP_MULTICAST_LOOP not enabled");

0 comments on commit c23d1de

Please sign in to comment.