Opened 3 years ago

#17685 new bug

Connecting to 'Haiku' depot fails if IPv6 inactive

Reported by: kumba Owned by: axeld
Priority: normal Milestone: Unscheduled
Component: Network & Internet/Stack Version: R1/beta3
Keywords: Cc:
Blocked By: Blocking:
Platform: x86-64

Description

At least I am pretty sure it's due to IPv6 being disabled.

Currently, I have, or I think I have, IPv6 disabled on my Haiku VM. In the Network preferences dialog, it is impossible to change "IPv6" to "Disabled" -- the dropdown forces to "Automatic". Nonetheless, I edited /system/settings/network/interfaces and removed any references to IPv6 to make sure IPv6 was fully disabled.

However, It appears that Haiku still tries to use IPv6 addressing before IPv4 if a DNS lookup returns BOTH formats, but sends AAAA responses ahead of A responses.

In this instance, if I try to run 'pkgman update', with the following repository configuration:

Haiku: https://eu.hpkg.haiku-os.org/haiku/r1beta3/x86_64/current HaikuPorts: https://eu.hpkg.haiku-os.org/haikuports/r1beta3/x86_64/current

Then pkgman will resolve "eu.hpkg.haiku-os.org" and receive an IPv6 address followed by an IPv4 address. Because I have disabled IPv6, pkgman fails to connect and gives up on the 'Haiku' depot. It then tries HaikuPorts, but appears to have walked down to the next DNS response, which is an IPv4 address, and that succeeds, so it fetches repository information for 'HaikuPorts' and can apply any updates.

I make an assumption that pkgman is failing on the IPv6 address because I believe an IPv6 address is being returned first in the DNS response data. I tried to wget the 'current' file for the 'Haiku' repo and wget shows that the DNS resolution for that EU URL returns an IPv6 address first, then an IPv4 address:

https://imgur.com/a/iXFD9hY

The workaround I used was to change to the US version of the URL (hosted by CloudFlare it looks) at https://us.hpkg.haiku-os.org/haiku/r1beta3/x86_64/current, and while a DNS resolution for that address returns both IPv4 and IPv6 responses, the IPv4 responses are sent first, so pkgman succeeds in connecting and fetching the repo file to check for updates.

However, it looks like the US URL does not hold current updates for HaikuPorts fot 'r1beta3' (it only has 'master'), so I have to leave that at the EU URL address. So far, this doesn't seem to affect pkgman pulling down updates for HaikuPorts.

It seems that there needs to be several fixes here:

  1. Fix the dropdown in Network preferences to support disabling IPv6
  2. Add the ability for the user to specify network stack preference (in FreeBSD, this is done via setting ip6addrctl_policy to an appropriate value, like "ipv4_prefer").
  3. Fix how pkgman handles receiving/connecting to an address family that is disabled in the system (or fix the DNS response for this URL to return IPv4 answers before IPv6 answers).
  4. Consider syncing the HaikuPorts 'r1beta3' data to the US URL hosted by CloudFlare IPFS.

Change History (0)

Note: See TracTickets for help on using tickets.