GNU bug report logs - #14779
24.3; Failure to resolve IPv6 addresses in make-network-process

Previous Next

Package: emacs;

Reported by: toke <at> toke.dk (Toke Høiland-Jørgensen)

Date: Wed, 3 Jul 2013 15:43:04 UTC

Severity: normal

Tags: moreinfo

Found in version 24.3

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14779 in the body.
You can then email your comments to 14779 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14779; Package emacs. (Wed, 03 Jul 2013 15:43:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to toke <at> toke.dk (Toke Høiland-Jørgensen):
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 03 Jul 2013 15:43:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: toke <at> toke.dk (Toke Høiland-Jørgensen)
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; Failure to resolve IPv6 addresses in make-network-process
Date: Wed, 03 Jul 2013 15:33:50 +0200
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.

Perusing the source code of process.c, it seems to me that it *should*
do the right thing, when :family is nil, and I can't figure out why it's
not.

I have installed Emacs from the binary packages provided by my
distribution (Arch linux).

Regards,
-Toke


In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.1)
 of 2013-04-29 on eric
Windowing system distributor `The X.Org Foundation', version 11.0.11402000
Configured using:
 `configure '--prefix=/usr' '--sysconfdir=/etc' '--libexecdir=/usr/lib'
 '--localstatedir=/var' '--with-x-toolkit=gtk3' '--with-xft'
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector
 --param=ssp-buffer-size=4'
 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_MESSAGES: en_GB.UTF-8
  value of $LANG: da_DK.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: ERC

Features:
(shadow bbdb-message mail-extr emacsbug message idna rfc822 mml mml-sec
mm-decode mm-bodies mm-encode gmm-utils mailheader sendmail mail-utils
misearch multi-isearch gnutls network-stream starttls erc-menu erc-join
erc-ring erc-pcomplete erc-track erc-match erc-button erc-fill erc-stamp
erc-netsplit autoinsert eieio-opt helm-misc helm-files image-dired ffap
helm-tags helm-bookmark helm-adaptative helm-info helm-net browse-url
helm-plugin bookmark helm-locate helm-help helm-match-plugin
helm-external helm-buffers helm-grep helm-regexp grep helm-elscreen
helm-utils helm find-file-in-repository-autoloads flymake-lua-autoloads
lua-mode-autoloads sauron-autoloads yaml-mode-autoloads package xcscope
helm-config sunrise-x-loop sunrise-commander recentf tree-widget
wid-edit sort hl-line find-dired esh-var esh-io esh-cmd esh-opt esh-ext
esh-proc esh-arg eldoc esh-groups eshell esh-util esh-module esh-mode
enriched dired-x dired-aux desktop preview-latex tex-site auto-loads
undo-tree autopair browse-kill-ring iedit gnus-article-treat-patch
gnus-dired dired magit-bisect magit-key-mode magit epa epg epg-config
diff-mode uniquify auto-complete-config auto-complete popup pydoc-info
info-look info python-mode rx cc-cmds compile ropemacs pymacs cc-styles
cc-align cc-engine cc-vars cc-defs bbdb-mua bbdb-vcard bbdb-com crm
mailabbrev vcard bbdb timezone bbdb-loaddefs znc erc-services
erc-networks erc-spelling flyspell ispell erc-goodies erc erc-backend
erc-compat thingatpt pp notify dbus w3m-load multi-term term disp-table
ehelp electric post ox-beamer org-caldav icalendar diary-lib
diary-loaddefs org-id ox-latex ox-icalendar ox-html ox-ascii ox-publish
ox org-element url-http tls url url-proxy url-privacy url-expand
url-methods url-history mailcap url-auth mail-parse rfc2231 rfc2047
rfc2045 ietf-drums url-cookie url-domsuf url-gw url-dav url-handlers
url-util url-parse url-vars xml org-protocol org org-macro org-footnote
org-pcomplete org-list org-faces org-entities noutline outline
org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table
ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs
org-loaddefs find-func cal-menu calendar cal-loaddefs
solarized-dark-theme solarized-definitions ido autorevert alist pym
static apel-ver product jka-compr protbuf tramp tramp-compat auth-source
eieio warnings byte-opt bytecomp byte-compile cconv inversion gnus-util
mm-util mail-prsvr password-cache tramp-loaddefs shell pcomplete comint
ansi-color format-spec nxhtml-autostart nxhtml-autoload majmodpri vc-git
nxhtml-menu web-autoload nxhtml-base wc yasnippet help-mode skeleton
paren cus-start cus-load log-edit ring pcvs-util add-log server
zencoding-mode ebib derived advice advice-preload help-fns cl-macs gv
bibtex easymenu cl cl-lib edmacro kmacro gnus-load easy-mmode time-date
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
register page menu-bar rfn-eshadow timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14779; Package emacs. (Wed, 03 Jul 2013 16:42:02 GMT) Full text and rfc822 format available.

Message #8 received at 14779 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: toke <at> toke.dk (Toke Høiland-Jørgensen)
Cc: 14779 <at> debbugs.gnu.org
Subject: Re: bug#14779: 24.3;
 Failure to resolve IPv6 addresses in make-network-process
Date: Wed, 03 Jul 2013 18:41:42 +0200
I cannot reproduce that.  What does getent ahosts show?

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14779; Package emacs. (Wed, 03 Jul 2013 16:52:01 GMT) Full text and rfc822 format available.

Message #11 received at 14779 <at> debbugs.gnu.org (full text, mbox):

From: Toke Høiland-Jørgensen <toke <at> toke.dk>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 14779 <at> debbugs.gnu.org
Subject: Re: bug#14779: 24.3;
 Failure to resolve IPv6 addresses in make-network-process
Date: Wed, 03 Jul 2013 18:51:37 +0200
[Message part 1 (text/plain, inline)]
Andreas Schwab <schwab <at> linux-m68k.org> writes:

> I cannot reproduce that.  What does getent ahosts show?

$ getent ahosts
127.0.0.1       localhost.localdomain localhost
127.0.0.1       localhost.localdomain localhost

$ getent ahostsv6
127.0.0.1       localhost.localdomain localhost
127.0.0.1       localhost.localdomain localhost

Other applications do not seem to have problems resolving dual-address
hosts. And as I mentioned, passing :family 0 to make-network-process
makes emacs correctly resolve the addresses as well...

-Toke
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14779; Package emacs. (Wed, 03 Jul 2013 20:05:02 GMT) Full text and rfc822 format available.

Message #14 received at 14779 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Toke Høiland-Jørgensen <toke <at> toke.dk>
Cc: 14779 <at> debbugs.gnu.org
Subject: Re: bug#14779: 24.3;
 Failure to resolve IPv6 addresses in make-network-process
Date: Wed, 03 Jul 2013 22:04:10 +0200
Please pass it the address to resolve.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14779; Package emacs. (Wed, 03 Jul 2013 20:23:02 GMT) Full text and rfc822 format available.

Message #17 received at 14779 <at> debbugs.gnu.org (full text, mbox):

From: Toke Høiland-Jørgensen <toke <at> toke.dk>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 14779 <at> debbugs.gnu.org
Subject: Re: bug#14779: 24.3;
 Failure to resolve IPv6 addresses in make-network-process
Date: Wed, 03 Jul 2013 22:22:36 +0200
[Message part 1 (text/plain, inline)]
Andreas Schwab <schwab <at> linux-m68k.org> writes:

> Please pass it the address to resolve.

Oh, right. Sorry.

$ getent ahosts google.com
2a00:1450:4013:c00::71 STREAM google.com
2a00:1450:4013:c00::71 DGRAM  
2a00:1450:4013:c00::71 RAW    
195.249.80.32   STREAM 
195.249.80.32   DGRAM  
195.249.80.32   RAW    
195.249.80.46   STREAM 
195.249.80.46   DGRAM  
195.249.80.46   RAW    
195.249.80.25   STREAM 
195.249.80.25   DGRAM  
195.249.80.25   RAW    
195.249.80.53   STREAM 
195.249.80.53   DGRAM  
195.249.80.53   RAW    
195.249.80.52   STREAM 
195.249.80.52   DGRAM  
195.249.80.52   RAW    
195.249.80.39   STREAM 
195.249.80.39   DGRAM  
195.249.80.39   RAW    
195.249.80.59   STREAM 
195.249.80.59   DGRAM  
195.249.80.59   RAW    
195.249.80.38   STREAM 
195.249.80.38   DGRAM  
195.249.80.38   RAW    
195.249.80.24   STREAM 
195.249.80.24   DGRAM  
195.249.80.24   RAW    
195.249.80.18   STREAM 
195.249.80.18   DGRAM  
195.249.80.18   RAW    
195.249.80.31   STREAM 
195.249.80.31   DGRAM  
195.249.80.31   RAW    
195.249.80.45   STREAM 
195.249.80.45   DGRAM  
195.249.80.45   RAW

-Toke
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14779; Package emacs. (Wed, 23 Oct 2019 11:40:01 GMT) Full text and rfc822 format available.

Message #20 received at 14779 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: toke <at> toke.dk (Toke Høiland-Jørgensen)
Cc: 14779 <at> debbugs.gnu.org
Subject: Re: bug#14779: 24.3; Failure to resolve IPv6 addresses in
 make-network-process
Date: Wed, 23 Oct 2019 13:39:53 +0200
toke <at> toke.dk (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.

Are you still seeing these problems?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 23 Oct 2019 11:41:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14779; Package emacs. (Wed, 23 Oct 2019 12:25:02 GMT) Full text and rfc822 format available.

Message #25 received at 14779 <at> debbugs.gnu.org (full text, mbox):

From: Toke Høiland-Jørgensen <toke <at> toke.dk>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 14779 <at> debbugs.gnu.org
Subject: Re: bug#14779: 24.3;
 Failure to resolve IPv6 addresses in make-network-process
Date: Wed, 23 Oct 2019 14:24:40 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> toke <at> toke.dk (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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14779; Package emacs. (Thu, 24 Oct 2019 11:46:01 GMT) Full text and rfc822 format available.

Message #28 received at 14779 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Toke Høiland-Jørgensen <toke <at> toke.dk>
Cc: 14779 <at> debbugs.gnu.org
Subject: Re: bug#14779: 24.3; Failure to resolve IPv6 addresses in
 make-network-process
Date: Thu, 24 Oct 2019 13:45:31 +0200
Toke Høiland-Jørgensen <toke <at> toke.dk> writes:

> 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 :)

Great; closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 14779 <at> debbugs.gnu.org and toke <at> toke.dk (Toke Høiland-Jørgensen) Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 24 Oct 2019 11:46:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 21 Nov 2019 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 217 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.