|
1 | 1 | /* |
2 | | - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
30 | 30 | * PromiscuousIPv6 |
31 | 31 | * @run main PromiscuousIPv6 |
32 | 32 | * @key randomness |
| 33 | + * @requires (os.family == "linux") | (os.family == "mac") |
33 | 34 | */ |
34 | 35 |
|
35 | 36 | import java.nio.ByteBuffer; |
@@ -201,26 +202,15 @@ static void test(ProtocolFamily family, |
201 | 202 | } |
202 | 203 | } |
203 | 204 |
|
204 | | - /* |
205 | | - * returns true if platform allows an IPv6 socket join an IPv4 multicast group |
206 | | - */ |
207 | | - private static boolean supportedByPlatform() { |
208 | | - return Platform.isOSX() || Platform.isLinux(); |
209 | | - } |
210 | | - |
211 | 205 | public static void main(String[] args) throws IOException { |
212 | 206 |
|
213 | 207 | boolean hasIPV6MulticastAll; |
214 | 208 |
|
215 | | - if (!supportedByPlatform()) { |
216 | | - throw new SkippedException("This test should not be run on this platform"); |
217 | | - } else { |
218 | | - int major = Platform.getOsVersionMajor(); |
219 | | - int minor = Platform.getOsVersionMinor(); |
220 | | - hasIPV6MulticastAll = |
221 | | - Platform.isOSX() || |
222 | | - (Platform.isLinux() && ((major > 4) || ((major == 4 && minor >= 20)))); |
223 | | - } |
| 209 | + int major = Platform.getOsVersionMajor(); |
| 210 | + int minor = Platform.getOsVersionMinor(); |
| 211 | + hasIPV6MulticastAll = |
| 212 | + Platform.isOSX() || |
| 213 | + (Platform.isLinux() && ((major > 4) || ((major == 4 && minor >= 20)))); |
224 | 214 |
|
225 | 215 | NetworkConfiguration.printSystemConfiguration(System.out); |
226 | 216 | List<NetworkInterface> nifs = NetworkConfiguration.probe() |
|
0 commit comments