* bug#14779: 24.3; Failure to resolve IPv6 addresses in make-network-process
@ 2013-07-03 13:33 Toke Høiland-Jørgensen
2013-07-03 16:41 ` Andreas Schwab
2019-10-23 11:39 ` Lars Ingebrigtsen
0 siblings, 2 replies; 8+ messages in thread
From: Toke Høiland-Jørgensen @ 2013-07-03 13:33 UTC (permalink / raw)
To: 14779
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)
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#14779: 24.3; Failure to resolve IPv6 addresses in make-network-process
2013-07-03 13:33 bug#14779: 24.3; Failure to resolve IPv6 addresses in make-network-process Toke Høiland-Jørgensen
@ 2013-07-03 16:41 ` Andreas Schwab
2013-07-03 16:51 ` Toke Høiland-Jørgensen
2019-10-23 11:39 ` Lars Ingebrigtsen
1 sibling, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2013-07-03 16:41 UTC (permalink / raw)
To: Toke Høiland-Jørgensen; +Cc: 14779
I cannot reproduce that. What does getent ahosts show?
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#14779: 24.3; Failure to resolve IPv6 addresses in make-network-process
2013-07-03 16:41 ` Andreas Schwab
@ 2013-07-03 16:51 ` Toke Høiland-Jørgensen
2013-07-03 20:04 ` Andreas Schwab
0 siblings, 1 reply; 8+ messages in thread
From: Toke Høiland-Jørgensen @ 2013-07-03 16:51 UTC (permalink / raw)
To: Andreas Schwab; +Cc: 14779
[-- Attachment #1: Type: text/plain, Size: 537 bytes --]
Andreas Schwab <schwab@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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 489 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#14779: 24.3; Failure to resolve IPv6 addresses in make-network-process
2013-07-03 16:51 ` Toke Høiland-Jørgensen
@ 2013-07-03 20:04 ` Andreas Schwab
2013-07-03 20:22 ` Toke Høiland-Jørgensen
0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2013-07-03 20:04 UTC (permalink / raw)
To: Toke Høiland-Jørgensen; +Cc: 14779
Please pass it the address to resolve.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#14779: 24.3; Failure to resolve IPv6 addresses in make-network-process
2013-07-03 20:04 ` Andreas Schwab
@ 2013-07-03 20:22 ` Toke Høiland-Jørgensen
0 siblings, 0 replies; 8+ messages in thread
From: Toke Høiland-Jørgensen @ 2013-07-03 20:22 UTC (permalink / raw)
To: Andreas Schwab; +Cc: 14779
[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]
Andreas Schwab <schwab@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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 489 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#14779: 24.3; Failure to resolve IPv6 addresses in make-network-process
2013-07-03 13:33 bug#14779: 24.3; Failure to resolve IPv6 addresses in make-network-process Toke Høiland-Jørgensen
2013-07-03 16:41 ` Andreas Schwab
@ 2019-10-23 11:39 ` Lars Ingebrigtsen
2019-10-23 12:24 ` Unknown
1 sibling, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-23 11:39 UTC (permalink / raw)
To: Toke Høiland-Jørgensen; +Cc: 14779
toke@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
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#14779: 24.3; Failure to resolve IPv6 addresses in make-network-process
2019-10-23 11:39 ` Lars Ingebrigtsen
@ 2019-10-23 12:24 ` Unknown
2019-10-24 11:45 ` Lars Ingebrigtsen
0 siblings, 1 reply; 8+ messages in thread
From: Unknown @ 2019-10-23 12:24 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 14779
Lars Ingebrigtsen <larsi@gnus.org> writes:
> toke@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
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#14779: 24.3; Failure to resolve IPv6 addresses in make-network-process
2019-10-23 12:24 ` Unknown
@ 2019-10-24 11:45 ` Lars Ingebrigtsen
0 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-24 11:45 UTC (permalink / raw)
To: Toke Høiland-Jørgensen; +Cc: 14779
Toke Høiland-Jørgensen <toke@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
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-10-24 11:45 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-03 13:33 bug#14779: 24.3; Failure to resolve IPv6 addresses in make-network-process Toke Høiland-Jørgensen
2013-07-03 16:41 ` Andreas Schwab
2013-07-03 16:51 ` Toke Høiland-Jørgensen
2013-07-03 20:04 ` Andreas Schwab
2013-07-03 20:22 ` Toke Høiland-Jørgensen
2019-10-23 11:39 ` Lars Ingebrigtsen
2019-10-23 12:24 ` Unknown
2019-10-24 11:45 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.