mojira.dev
MC-19301

Connecting to IPv6 IP address fails since 1.6 (1.5.2 works)

When launching minecraft 1.5.2, I can connect to an IPv6 address (using the usual [aa:bb:cc::1]:12345 format). When launching the 1.6 prerelease, minecraft fails with "java.net.SocketException: Protocol family unavailable".

I use the new launcher in both tests.

Linked issues

Attachments

Comments 17

Please provide full console output.

Thomas Bächler

Console output for minecraft 1.6 attached as "minecraft-console"

Thomas Bächler

From what I gathered from previous bug reports, mojang wants to prefer ipv4 over ipv6 due to problems some people seem to have. However, the option that seems to be used is java.net.preferIPv4Stack. This does way more (quoted from http://download.java.net/jdk7/archive/b123/docs/api/java/net/doc-files/net-properties.html):

java.net.preferIPv4Stack (default: false)
If IPv6 is available on the operating system the underlying native socket will be, by default, an IPv6 socket which lets applications connect to, and accept connections from, both IPv4 and IPv6 hosts. However, in the case an application would rather use IPv4 only sockets, then this property can be set to true. The implication is that it will not be possible for the application to communicate with IPv6 only hosts.

Since this property is not set via command line options, but inside the minecraft net/minecraft/client/main/Main.class, it cannot be overridden via command line options.

Reattached log as a .txt file so it can be read on a browser.

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

7 more comments

and anyway, since when did "Prefer IPv4" equate to "Don't use IPv6 at all"?

Thomas Bächler

> and anyway, since when did "Prefer IPv4" equate to "Don't use IPv6 at all"?

Since Java. The documentation states this fact clearly, but the naming is confusing.

Thomas Bächler

Could someone at mojang please revisit the whole ipv6 situation now that they completely rewrote the network stack using netty? I would guess that their "problems" with ipv6 might have gone away with that change.

Is this still a concern in the current Minecraft version 1.7.4 / Launcher version 1.3.7 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

My tests confirm this is still present in 1.7.4

And the first line of Main.main(String[]) is
System.setProperty("java.net.preferIPv4Stack", "true");

so that pretty much makes anything the launcher does irrelevant.

I don't think I can edit affected versions though.

Thomas Bächler

(Unassigned)

Unconfirmed

Minecraft 1.6, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.7.4

Retrieved