From a37d7bb5f3f1463d08295a1d465ed9cf9475eee8 Mon Sep 17 00:00:00 2001 From: norman Date: Wed, 11 Apr 2012 08:09:03 +0200 Subject: [PATCH] Make sure multicast tests pass on all os'es --- .../transport/socket/AbstractDatagramMulticastTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractDatagramMulticastTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractDatagramMulticastTest.java index 673688e10d..efdff083d0 100644 --- a/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractDatagramMulticastTest.java +++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractDatagramMulticastTest.java @@ -78,7 +78,8 @@ public abstract class AbstractDatagramMulticastTest { // check if the NetworkInterface is null, this is the case on my ubuntu dev machine but not on osx and windows. // if so fail back the the first interface if (iface == null) { - iface = NetworkInterface.getByIndex(0); + // use nextElement() as NetWorkInterface.getByIndex(0) returns null + iface = NetworkInterface.getNetworkInterfaces().nextElement(); } sb.setOption("networkInterface", iface); sb.setOption("reuseAddress", true);