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.
Related issues
duplicates
Attachments
Comments


Please provide full console output.

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

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.

I'm not fussed on preference, as you can specify a direct IPv6 address rather than using a domain name. Even if IPv6 has bugs, having it enabled then allows people to try it, see if it works for them, and report bugs. That's a good thing.
For me, IPv6 worked fine in 1.5.2, and doesn't work at all in 1.6.1
The below is from the dev console of the client, it appears to not deal with the IPv6 numeric address at all. The server list in 1.6.1 reports "Communication error" for a server specified as an IPv6 address (IP, not name).
I regard that as a regression: something that previously worked, doesn't now.
Client> 2013-07-03 14:06:40 [CLIENT] [INFO] Connecting to xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx, 25565
Client> java.net.SocketException: Protocol family unavailable
Client> at java.net.PlainSocketImpl.socketConnect(Native Method)
Client> at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
Client> at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
Client> at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
Client> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
Client> at java.net.Socket.connect(Socket.java:579)
Client> at java.net.Socket.connect(Socket.java:528)
Client> at java.net.Socket.<init>(Socket.java:425)
Client> at java.net.Socket.<init>(Socket.java:241)
Client> at bcn.<init>(SourceFile:70)
Client> at bcq.run(SourceFile:42)

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

I can't seem to find a way to confirm or append to this issue, but I came upon this bug myself now, as I was testing to set up an IPv6 only server. Issue is still present at 1.6.2 under both Linux and Windows 7.
I personally don't understand how Mojang can blame "broken IPv6 stacks" on connection issues, a broken IPv6 stack would for instance render Google and Facebook unusable for affected users.

This breaks a few minecraft servers I play on that are on an IPv6-only network. Rather disappointed that there is no longer a way for me to connect to these. If this doesn't get resolved soon, I may just mod the client to re-enable v6 support.

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.

you probably meant this:
-Djava.net.preferIPv4Stack=false
anyways, not supporting ipv6 by default is just ridiculous in the year 2013..

If Mojang do not agree to re-enable support by default then I would request that there at least be an option to switch IPv6 support back on again manually - without having to make code modifications.
I actually e-mailed the IPv6 Tunnel broker SIXXS a while back and pointed out to them that Minecraft works in IPv6 and they added it to their "Cool IPv6 stuff" page http://www.sixxs.net/misc/coolstuff/
but it seems now Minecraft is back in the 1990s

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

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

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.