unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34193: 26.1; make-network-proces :host 'local fails with ipv6
@ 2019-01-25  3:26 Ernesto Alfonso
  2019-01-25 14:04 ` Robert Pluim
  0 siblings, 1 reply; 7+ messages in thread
From: Ernesto Alfonso @ 2019-01-25  3:26 UTC (permalink / raw)
  To: 34193


    $ netstat -tlpn | grep 1959
    tcp6       0      0 ::1:1959                :::*                    LISTEN      1990/stumpwm        


    ELISP> (make-network-process :host 'local
                                 :service 1959
                                 :name "test")
    *** Eval error ***  make client process failed: Connection refused, :host, local, :service, 1959, :name, test
    ELISP> (make-network-process :host 'local
                                 :service 1959
                                 :name "test"
                                 :family 'ipv6)
    *** Eval error ***  127.0.0.1/1959 Address family for hostname not supported
    ELISP> (make-network-process :host "localhost"
                                 :service 1959
                                 :name "test")
    #<process test>
   
    



In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2019-01-15 built on debian-chafa
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description:	Debian GNU/Linux 9.6 (stretch)

Recent messages:
match found [19 times]
Mark set
Making completion list...
Type C-x 1 to delete the help window, C-M-v to scroll help.
Mark saved where search started
Quit
Mark saved where search started
Mark set [3 times]
Symbol’s function definition is void: erjoalgo-indent-mode
scroll-down-command: Beginning of buffer

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: IELM

Minor modes in effect:
  diff-auto-refine-mode: t
  text-scale-mode: t
  global-erjoalgo-command-mode: t
  erjoalgo-command-mode: t
  show-paren-mode: t
  global-text-scale-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/ealfonso/quicklisp/dists/quicklisp/software/slime-v2.23/slime-tests hides /home/ealfonso/.emacs.d/elpa/slime-20190120.2014/slime-tests
/home/ealfonso/quicklisp/dists/quicklisp/software/slime-v2.23/slime-autoloads hides /home/ealfonso/.emacs.d/elpa/slime-20190120.2014/slime-autoloads
/home/ealfonso/quicklisp/dists/quicklisp/software/slime-v2.23/slime hides /home/ealfonso/.emacs.d/elpa/slime-20190120.2014/slime
/home/ealfonso/quicklisp/dists/quicklisp/software/slime-v2.23/contrib/slime-cl-indent hides /home/ealfonso/git/dotemacs/lisp/libs/slime-cl-indent
/home/ealfonso/.emacs.d/elpa/dash-20180910.1856/dash hides /home/ealfonso/git/dotemacs/lisp/libs/dash
/home/ealfonso/.emacs.d/elpa/s-20180406.808/s hides /home/ealfonso/git/dotemacs/lisp/libs/s

Features:
(shadow sort mailalias mail-extr emacsbug eieio-opt speedbar sb-image
ezimage dframe misearch multi-isearch network-stream nsm starttls vc-git
diff-mode help-fns radix-tree ielm face-remap conf-mode ffap diary-lib
diary-loaddefs cal-iso org-rmail org-mhe org-irc org-info org-gnus nnir
gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int
gnus-range gnus-win org-docview doc-view jka-compr image-mode org-bibtex
bibtex org-bbdb org-w3m org-agenda flycheck rx subr-x tmp-completions
tetris-o-1 beeper translation babel json map mm-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap gnus nnheader wid-edit wm-windows slime-fancy
slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references
slime-compiler-notes-tree slime-scratch slime-presentations bridge
slime-macrostep macrostep slime-mdot-fu slime-enclosing-context
slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c
slime-editing-commands slime-autodoc slime-repl elp slime-parse slime
hi-lock company-oddmuse company-keywords company-etags company-gtags
company-dabbrev-code company-dabbrev company-files company-capf
company-cmake company-xcode company-clang company-semantic company-eclim
company-template company-bbdb elec-pair lisp-mnt gud apropos etags xref
project arc-mode archive-mode hyperspec browse-url ox-texinfo ox-odt
rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse
nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table
ox-ascii ox-publish ox org-crypt org-element avl-tree generator org
org-macro org-footnote org-pcomplete 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 cal-menu calendar cal-loaddefs warnings
erc-goodies erc erc-backend erc-compat thingatpt bbdb-mua bbdb-com crm
bbdb-message sendmail message rmc puny dired dired-loaddefs format-spec
rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader bbdb
bbdb-site timezone proxy-mode project-opener org-omnibar compile comint
ansi-color ring erjoalgo-command-mode cl-extra help-mode
command-mode-commands autobuild selcand anonymizer genpass ert pp
find-func ewoc debug sticky-windows company edmacro kmacro pcase
dedicated dash-functional plusx my-emacs-settings paren server
isearch-fast-reverse buttons zoom-global easy-mmode quick-yes advice
goto-last-change f dash s finder-inf slime-autoloads info cl package
easymenu epg-config url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt
gv bytecomp byte-compile cconv cl-loaddefs cl-lib time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 602155 68469)
 (symbols 48 56886 1)
 (miscs 40 260 620)
 (strings 32 169035 2984)
 (string-bytes 1 4892647)
 (vectors 16 54171)
 (vector-slots 8 951581 69716)
 (floats 8 328 488)
 (intervals 56 1725 254)
 (buffers 992 35))





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#34193: 26.1; make-network-proces :host 'local fails with ipv6
  2019-01-25  3:26 bug#34193: 26.1; make-network-proces :host 'local fails with ipv6 Ernesto Alfonso
@ 2019-01-25 14:04 ` Robert Pluim
  2019-01-26 11:04   ` Robert Pluim
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Pluim @ 2019-01-25 14:04 UTC (permalink / raw)
  To: Ernesto Alfonso; +Cc: 34193

Ernesto Alfonso <erjoalgo@gmail.com> writes:

>     $ netstat -tlpn | grep 1959
>     tcp6       0      0 ::1:1959                :::*                    LISTEN      1990/stumpwm        
>
>
>     ELISP> (make-network-process :host 'local
>                                  :service 1959
>                                  :name "test")
>     *** Eval error ***  make client process failed: Connection
>     refused, :host, local, :service, 1959, :name, test

Here emacs tries an AF_UNSPEC connection to 127.0.0.1

>     ELISP> (make-network-process :host 'local
>                                  :service 1959
>                                  :name "test"
>                                  :family 'ipv6)
>     *** Eval error ***  127.0.0.1/1959 Address family for hostname
>                                  not supported

Here it tries an AF_INET6 connection to 127.0.0.1, which obviously isnʼt
going to work. Itʼs a deliberate choice based on 
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=6781>

>     ELISP> (make-network-process :host "localhost"
>                                  :service 1959
>                                  :name "test")
>     #<process test>

And here we use AF_UNSPEC, and loop through whatever getaddrinfo
returns, so your IPv6 "localhost" works.

I guess if we make a change so that :host 'local means the same as
:host "localhost", your use case will work, but I worry about what
else that would break (and itʼs the opposite of bug#6781). Perhaps the
minimal change would be to use "::1" when specifying :family 'ipv6?

Robert





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#34193: 26.1; make-network-proces :host 'local fails with ipv6
  2019-01-25 14:04 ` Robert Pluim
@ 2019-01-26 11:04   ` Robert Pluim
  2019-01-26 11:06     ` Ernesto Alfonso
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Pluim @ 2019-01-26 11:04 UTC (permalink / raw)
  To: Ernesto Alfonso; +Cc: 34193

Robert Pluim <rpluim@gmail.com> writes:

> Perhaps the minimal change would be to use "::1" when specifying
> :family 'ipv6?

That would be this patch, which fixes this particular use case, and
shouldn't break anything else.

diff --git i/src/process.c w/src/process.c
index c0741403b5..72351db3e6 100644
--- i/src/process.c
+++ w/src/process.c
@@ -3983,14 +3983,24 @@ usage: (make-network-process &rest ARGS)  */)
 #ifdef HAVE_LOCAL_SOCKETS
       if (family != AF_LOCAL)
 #endif
-	host = build_string ("127.0.0.1");
+        {
+        if (family == AF_INET6)
+          host = build_string ("::1");
+        else
+          host = build_string ("127.0.0.1");
+        }
     }
   else
     {
       if (EQ (host, Qlocal))
+        {
 	/* Depending on setup, "localhost" may map to different IPv4 and/or
 	   IPv6 addresses, so it's better to be explicit (Bug#6781).  */
-	host = build_string ("127.0.0.1");
+        if (family == AF_INET6)
+          host = build_string ("::1");
+        else
+          host = build_string ("127.0.0.1");
+        }
       CHECK_STRING (host);
     }
 







^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#34193: 26.1; make-network-proces :host 'local fails with ipv6
  2019-01-26 11:04   ` Robert Pluim
@ 2019-01-26 11:06     ` Ernesto Alfonso
  2019-01-30  9:13       ` Robert Pluim
  0 siblings, 1 reply; 7+ messages in thread
From: Ernesto Alfonso @ 2019-01-26 11:06 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 34193

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]

Thanks for looking into this.

Ernesto

On Sat, Jan 26, 2019, 3:04 AM Robert Pluim <rpluim@gmail.com wrote:

> Robert Pluim <rpluim@gmail.com> writes:
>
> > Perhaps the minimal change would be to use "::1" when specifying
> > :family 'ipv6?
>
> That would be this patch, which fixes this particular use case, and
> shouldn't break anything else.
>
> diff --git i/src/process.c w/src/process.c
> index c0741403b5..72351db3e6 100644
> --- i/src/process.c
> +++ w/src/process.c
> @@ -3983,14 +3983,24 @@ usage: (make-network-process &rest ARGS)  */)
>  #ifdef HAVE_LOCAL_SOCKETS
>        if (family != AF_LOCAL)
>  #endif
> -       host = build_string ("127.0.0.1");
> +        {
> +        if (family == AF_INET6)
> +          host = build_string ("::1");
> +        else
> +          host = build_string ("127.0.0.1");
> +        }
>      }
>    else
>      {
>        if (EQ (host, Qlocal))
> +        {
>         /* Depending on setup, "localhost" may map to different IPv4 and/or
>            IPv6 addresses, so it's better to be explicit (Bug#6781).  */
> -       host = build_string ("127.0.0.1");
> +        if (family == AF_INET6)
> +          host = build_string ("::1");
> +        else
> +          host = build_string ("127.0.0.1");
> +        }
>        CHECK_STRING (host);
>      }
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 1988 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#34193: 26.1; make-network-proces :host 'local fails with ipv6
  2019-01-26 11:06     ` Ernesto Alfonso
@ 2019-01-30  9:13       ` Robert Pluim
  2019-01-30 19:47         ` Alan Third
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Pluim @ 2019-01-30  9:13 UTC (permalink / raw)
  To: Ernesto Alfonso; +Cc: 34193

Ernesto Alfonso <erjoalgo@gmail.com> writes:

> Thanks for looking into this.

I was hoping for 'I tested this and it works for me' :-)

Does anyone else have any comments? Otherwise Iʼll push the change
this weekend.

Robert





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#34193: 26.1; make-network-proces :host 'local fails with ipv6
  2019-01-30  9:13       ` Robert Pluim
@ 2019-01-30 19:47         ` Alan Third
  2019-02-04  9:40           ` Robert Pluim
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Third @ 2019-01-30 19:47 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Ernesto Alfonso, 34193

On Wed, Jan 30, 2019 at 10:13:45AM +0100, Robert Pluim wrote:
> Ernesto Alfonso <erjoalgo@gmail.com> writes:
> 
> > Thanks for looking into this.
> 
> I was hoping for 'I tested this and it works for me' :-)
> 
> Does anyone else have any comments? Otherwise Iʼll push the change
> this weekend.

I tested it and it works for me. ;)

-- 
Alan Third





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#34193: 26.1; make-network-proces :host 'local fails with ipv6
  2019-01-30 19:47         ` Alan Third
@ 2019-02-04  9:40           ` Robert Pluim
  0 siblings, 0 replies; 7+ messages in thread
From: Robert Pluim @ 2019-02-04  9:40 UTC (permalink / raw)
  To: Alan Third; +Cc: Ernesto Alfonso, 34193

tags 34193 fixed
close 34193 27.1
quit
Alan Third <alan@idiocy.org> writes:

> On Wed, Jan 30, 2019 at 10:13:45AM +0100, Robert Pluim wrote:
>> Ernesto Alfonso <erjoalgo@gmail.com> writes:
>> 
>> > Thanks for looking into this.
>> 
>> I was hoping for 'I tested this and it works for me' :-)
>> 
>> Does anyone else have any comments? Otherwise Iʼll push the change
>> this weekend.
>
> I tested it and it works for me. ;)

Thanks. Pushed as 49f6243027. Closing bug.

Robert





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-02-04  9:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-25  3:26 bug#34193: 26.1; make-network-proces :host 'local fails with ipv6 Ernesto Alfonso
2019-01-25 14:04 ` Robert Pluim
2019-01-26 11:04   ` Robert Pluim
2019-01-26 11:06     ` Ernesto Alfonso
2019-01-30  9:13       ` Robert Pluim
2019-01-30 19:47         ` Alan Third
2019-02-04  9:40           ` Robert Pluim

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).