-
Bug
-
Resolution: Done
-
Major
-
2.0.0.Final
-
None
Under specific configuration where:
1. an IPv4 multicast address is used
2. while java.net.preferIPv6Addresses=true is set
3. and while on Windows platform (i.e. or a platform that doesn't support binding to a multicast address)
the following exception can happen (example from when used in WildFly):
WFLYCTL0186: Services which failed to start: service org.wildfly.mod_cluster.service.default.undertow: java.nio.channels.UnsupportedAddressTypeException
Seemingly while we are using the same code as in JDK, the JDK simply doens't do the check again; from JDK11 code
private void bindInternal(SocketAddress local) throws IOException { assert Thread.holdsLock(stateLock) && (localAddress == null); InetSocketAddress isa; if (local == null) { // only Inet4Address allowed with IPv4 socket if (family == StandardProtocolFamily.INET) { isa = new InetSocketAddress(InetAddress.getByName("0.0.0.0"), 0); } else { isa = new InetSocketAddress(0); } } else { isa = Net.checkAddress(local, family); } SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkListen(isa.getPort()); Net.bind(family, fd, isa.getAddress(), isa.getPort()); localAddress = Net.localAddress(fd); }