mojira.dev

Thomas Bächler

Assigned

No issues.

Reported

MC-19301 Connecting to IPv6 IP address fails since 1.6 (1.5.2 works) Duplicate

Comments

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.

> 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.

Jonathan, that's what I have been predicting would happen.

Modding this out is not too hard, you just have to remove one line of code - but I actually don't want to be forced to mod my game for it to work correctly.

Plus, anyone who has problems once this line is removed can simply go to the launcher, edit their profile and add -Djava.net.preferIPv4Stack=true to the command line to make minecraft work again.

> I'm not fussed on preference, as you can specify a direct IPv6 address rather than using a domain name.

No you can't. The property java.net.preferIPv4stack=false disabled that possibility, which I think I stated clearly in my description. Any attempt in connecting to an IPv6 address will fail with "Protocol family unavaiblable".

> For me, IPv6 worked fine in 1.5.2, and doesn't work at all in 1.6.1

That's because the old launcher set java.net.preferIPv4stack=false in the launcher and didn't spawn a new process. 1.5.2 consequently didn't set this property at all and relied on it being set by the launcher. Using the dev launcher in 1.5.2 thus resulted in working IPv6.

Now, 1.6.1 sets this property inside minecraft, and it is impossible to override.

> Even if IPv6 has bugs

That's another point - it doesn't. The force-disabling of ipv6 in minecraft is based entirely on wrong assumptions. The reason this is disabled everywhere is MCL-59 and other bug reports like it. Even though the server mentioned there (s3.amazonaws.com) only resolves to an IPv4 address, you get an exception.

So why does it fail for these people? Modern operating systems (ALL of them) use the IPv6 stack even when connecting to IPv4 (the operating system transparently falls back to ipv4). As can be seen in MCL-59, it was third-party software that messed with the network stack and thus broke it (and updating that software resolved the problem). Any vanilla Windows Vista, Windows XP, Mac OS or Linux system will work just fine, unless you install software that messes with your network stack in unpredictable ways.

So, mojang is catering to users that have broken software installed and at the same time removing functionality for people who have properly working computers.

Now, I don't care if the launcher forces itself to use only IPv4, but I really want to be able to use IPv6 in the minecraft client itself - so the least I would want is a possibility to override this behaviour.

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.

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