mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-26 10:10:19 +00:00
8146482: [TESTBUG] java/net/SocketOption/OptionTest should only use multicast capable interfaces for multicast tests
Reviewed-by: chegar
This commit is contained in:
parent
02b6ec0612
commit
f837501797
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2016, 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
|
||||
@ -80,8 +80,11 @@ public class OptionsTest {
|
||||
static NetworkInterface getNetworkInterface() {
|
||||
try {
|
||||
Enumeration<NetworkInterface> nifs = NetworkInterface.getNetworkInterfaces();
|
||||
if (nifs.hasMoreElements()) {
|
||||
return (NetworkInterface)nifs.nextElement();
|
||||
while (nifs.hasMoreElements()) {
|
||||
NetworkInterface ni = (NetworkInterface)nifs.nextElement();
|
||||
if (ni.supportsMulticast()) {
|
||||
return ni;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user