Fix a NPE in a testcase when running via ubuntu

This commit is contained in:
norman 2012-04-10 08:12:10 +02:00
parent 07ff3d76cd
commit 32f61ed01a

View File

@ -28,7 +28,6 @@ import io.netty.channel.socket.DatagramChannelFactory;
import io.netty.testsuite.util.TestUtils; import io.netty.testsuite.util.TestUtils;
import io.netty.util.internal.ExecutorUtil; import io.netty.util.internal.ExecutorUtil;
import java.net.InetAddress;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.NetworkInterface; import java.net.NetworkInterface;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
@ -73,7 +72,7 @@ public abstract class AbstractDatagramMulticastTest {
int port = TestUtils.getFreePort(); int port = TestUtils.getFreePort();
NetworkInterface iface = NetworkInterface.getByInetAddress(InetAddress.getLoopbackAddress()); NetworkInterface iface = NetworkInterface.getNetworkInterfaces().nextElement();
sb.setOption("networkInterface", iface); sb.setOption("networkInterface", iface);
sb.setOption("reuseAddress", true); sb.setOption("reuseAddress", true);