abarisain / dmix

A modern MPD Client for Android.
Apache License 2.0
591 stars 198 forks source link

does not fallback to IPv4 when IPv6 address is not working #847

Open majewsky opened 7 years ago

majewsky commented 7 years ago

There's an MPD server at my hackerspace under the locally-resolvable hostname cider, so I've configured this server for the space's WiFi network. This is what I'm seeing:

screenshot_20170817-165011

The German part of the message says "The connection to the MPD server failed! Please check if the server is reachable."

The problem is, MPDroid is committing a very common error here. IPv6 connectivity is currently broken, so the server's IPv6 address does not work (yielding the error seen in the screenshot), but IPv4 connectivity is still working. MPDroid should fall back to the IPv4 address before complaining to the user, but it doesn't.

To witness, this is how everything looks from my notebook: The server has both an IPv4 and an IPv6 address in the DNS, IPv4 works, IPv6 doesn't, and other clients (like mpc shown here) can figure out how to behave correctly.

$ host cider
cider has address 172.22.99.205
cider has IPv6 address 2001:470:6d:670:20d:93ff:fe75:eefa
$ ncat -4 cider 6600
OK MPD 0.18.0
$ ncat -6 cider 6600
Ncat: Connection refused.
$ MPD_HOST=cider mpc
Anamanaguchi - Danger Mountain
[playing] #4/15   0:26/2:12 (19%)
volume: 46%   repeat: off   random: off   single: off   consume: off
abarisain commented 7 years ago

Hi!

MPdroid is not doing anything itself with the connection, and simply uses standard java apis to connect to a hostname.

This honestly looks like an Android misconfiguration, or Android bug