Bug#636871: provide a command-line switch to prefer IPv6 or IPv4
- To: Ludens <ludens@turingmachine.eu>, 636871@bugs.debian.org
- Subject: Bug#636871: provide a command-line switch to prefer IPv6 or IPv4
- From: Julian Andres Klode <jak@debian.org>
- Date: Tue, 2 Jan 2018 16:24:08 +0100
- Message-id: <[🔎] 20180102161813.GA6135@debian.org>
- Reply-to: Julian Andres Klode <jak@debian.org>, 636871@bugs.debian.org
- In-reply-to: <d9e413ba-0bda-e9a5-3a02-a503e51e9a93@turingmachine.eu>
- References: <147963740517.26981.13132477156456558044.reportbug@ermintrude.seoss.co.uk> <20161120121248.rzfymfvke6lbp3tx@crossbow> <20171007232622.GA17324@debian.org> <20171007232622.GA17324@debian.org> <20110806154857.6050.37027.reportbug@localhost> <d9e413ba-0bda-e9a5-3a02-a503e51e9a93@turingmachine.eu> <20110806154857.6050.37027.reportbug@localhost>
On Tue, Oct 10, 2017 at 11:12:16PM +0200, Ludens wrote:
> On Sat, 7 Oct 2017 23:28:57 +0200 Julian Andres Klode <jak@debian.org>
> wrote:
> > JFTR: I wrote an implementation of parts of happy eyeballs for another
> > bug we should probably merge in here, but it fails the test suite on
> > CI: https://github.com/julian-klode/apt/commits/bugfix/happy-eyeballs
> >
> > I started a rewrite of that in another local branch, but it's not
> > done yet.
>
> Hi,
>
> I started some work on this without knowing about the code that was
> there. The patch attached implements Happy Eyeballs in (roughly) the
> following way:
>
> In ConnectToHostname, if the first DoConnect does not complete within
> 300ms, another DoConnect is performed with an address of a different IP
> family. So, if the first DoConnect used IPv6, the second will use IPv4
> and vice versa. Of these two connection attempts, the first one that
> completes will be used. The precedence ordering of getaddrinfo is also
> taken into account. Hopefully, this is helpful.
I looked at the patch, but it did not look very neatly structured to
me - more like the rest of the code... ;). My second attempt now is:
https://github.com/Debian/apt/compare/master...julian-klode:pu/happy-eyeballs?expand=1
It's basically building lists of Connection objects and waiting on these,
using the first successful connection (and waiting only 300 ms after adding
a preferred connection, and then waiting the specified time out after optionally
adding a non-preferred connection family).
That said, I do not have a system with broken IPv6 routing, so
I can't really test it. It's also not entirely neat yet either...
--
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer i speak de, en
Reply to: