[jboss-jira] [JBoss JIRA] (WFCORE-4740) (7.3.0) preferIPv6Addresses and preferIPv4Stack System Properties are Mishandled in the Config

Ivo Studensky (Jira) issues at jboss.org
Tue Nov 5 03:36:00 EST 2019


Ivo Studensky created WFCORE-4740:
-------------------------------------

             Summary: (7.3.0) preferIPv6Addresses and preferIPv4Stack System Properties are Mishandled in the Config
                 Key: WFCORE-4740
                 URL: https://issues.jboss.org/browse/WFCORE-4740
             Project: WildFly Core
          Issue Type: Bug
          Components: Server
    Affects Versions: 10.0.0.Final
         Environment: * JBoss EAP 7.1/7.2
* Interface attached to port 0.0.0.0
* Red Hat Enterprise Linux 7
* IPv6 disabled in the kernel
    sysctl -w net.ipv6.conf.all.disable_ipv6=1
    sysctl -w net.ipv6.conf.default.disable_ipv6=1
* System properties -Djava.net.preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true

            Reporter: Ivo Studensky
            Assignee: Teresa Miyar Gil
             Fix For: 11.0.0.Beta1


Error is thrown on startup.

Caused by: java.net.SocketException: Protocol family unavailable
	at sun.nio.ch.Net.bind0(Native Method)
	at sun.nio.ch.Net.bind(Net.java:433)
	at sun.nio.ch.Net.bind(Net.java:425)
	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
	at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
	at org.xnio.nio.NioXnioWorker.createTcpConnectionServer(NioXnioWorker.java:179)
	at org.xnio.XnioWorker.createStreamConnectionServer(XnioWorker.java:310)
	at io.undertow.protocols.ssl.UndertowXnioSsl.createSslConnectionServer(UndertowXnioSsl.java:301)
	at org.wildfly.extension.undertow.HttpsListenerService.startListening(HttpsListenerService.java:127)


The customer ships a turn key solution that has the two system properties set: -Djava.net.preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true because they are needed for some cases for customers running IPv6,  but others want to harden their systems by disabling IPv4.

This works on JBoss EAP 6, but it throws the error on JBoss EAP 7 on the same version of Java.  Furthermore, adding just Djava.net.preferIPv4Stack=false has the same issue, even though it the default value, while leaving it off starts.

This appears to be related to  controller/src/main/java/org/jboss/as/controller/interfaces/OverallInterfaceCriteria.java#pruneIPTypes where if both properties are null, it leaves the set of candidate addresses alone, but it either are set, it strips out all IPv4 addresses.  




--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jboss-jira mailing list