Subject: bug#14779: 24.3; Failure to resolve IPv6 addresses in make-network-process

From: Toke Høiland-Jørgensen <[email-masked]>
Date: Wed, 23 Oct 2019 14:24:40 +0200

Lars Ingebrigtsen <[email-masked]> writes:

> [email-masked] (Toke Høiland-Jørgensen) writes:
>
>> I'm using ERC to connect to IRC, and was wondering why the connection
>> used IPv4 rather than IPv6 when the server has both addresses
>> configured. Messing with the DNS resolver so the address only resolves
>> to IPv6 made Emacs unable to connect at all.
>>
>> Investigating this further, it seems that by default
>> make-network-process does not resolve IPv6 addresses at all unless
>> specifically asked to do so. More precisely, patch open-network-stream
>> to pass :family 0 (line 143 of network-stream.el) makes resolution work
>> as expected (i.e. first IPv6, then v4 if no v6 address exists), but the
>> default of leaving out the :family parameter (or setting it to nil)
>> makes resolution IPv4-only, resulting in a 'Name or service not known'
>> error when trying to connect.
>
> The code has changed substantially in the six years since this was
> reported.

Heh, indeed.

> Are you still seeing these problems?

No idea. I stopped using erc in the meantime; not that long ago, though,
and don't think I had this problem when I most recently used it (the
host I was connecting to still had only v6 addresses).

So as far as I'm concerned, feel free to go ahead and close this :)

-Toke