unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
Cc: 40343@debbugs.gnu.org
Subject: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows
Date: Tue, 31 Mar 2020 15:01:05 +0200	[thread overview]
Message-ID: <m2zhbw3cha.fsf@gmail.com> (raw)
In-Reply-To: <vriu4ku4lr5h.wl--xmue@d1.dion.ne.jp> (Kazuhiro Ito's message of "Tue, 31 Mar 2020 20:06:50 +0900")

>>>>> On Tue, 31 Mar 2020 20:06:50 +0900, Kazuhiro Ito <kzhr@d1.dion.ne.jp> said:

    Kazuhiro> dns-set-servers function fails to set dns-servers on Windows with IPv6
    Kazuhiro> available network.
    >> 
    Kazuhiro> (progn
    Kazuhiro> (require 'dns)
    Kazuhiro> (dns-set-servers)
    Kazuhiro> dns-servers)
    >> 
    -> (nil)
    >> 
    >> dns.el isnʼt going to work on Windows anyway, since Emacs doesnʼt
    >> support UDP network processes on Windows.

    Kazuhiro> Cygwin's Emacs, which seems to support UDP network processes, uses
    Kazuhiro> Windows's nslookup.exe, so has this problem too.  

Thatʼs not a Windows Emacs :-)

    Kazuhiro> # Actually I don't directly use dns.el.  It is gravatar.el which uses
    Kazuhiro> # dns.el.

True. We should teach emacs about res_query.

Does this work for you:

diff --git a/lisp/net/dns.el b/lisp/net/dns.el
index 78d4827162..fd2ea99ac6 100644
--- a/lisp/net/dns.el
+++ b/lisp/net/dns.el
@@ -328,7 +328,7 @@ dns-set-servers
 	  (call-process "nslookup" nil t nil "localhost")
 	  (goto-char (point-min))
 	  (re-search-forward
-	   "^Address:[ \t]*\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)" nil t)
+	   "^Address:[ \t]*\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)\\|\\([[:xdigit:]:]*\\)" nil t)
 	  (setq dns-servers (list (match-string 1))))))
   (when (fboundp 'network-interface-list)
     (setq dns-servers-valid-for-interfaces (network-interface-list))))





  reply	other threads:[~2020-03-31 13:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-31  8:46 bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows Kazuhiro Ito
2020-03-31  9:50 ` Robert Pluim
2020-03-31 11:06   ` Kazuhiro Ito
2020-03-31 13:01     ` Robert Pluim [this message]
2020-03-31 14:22       ` Kazuhiro Ito
2020-03-31 14:28         ` Robert Pluim
2020-04-01 13:43           ` Kazuhiro Ito
2020-04-01 13:57             ` Robert Pluim
2020-04-01 14:55               ` Kazuhiro Ito
2020-04-03  8:42                 ` Robert Pluim
2020-04-03 14:08                   ` Kazuhiro Ito
2020-04-03 15:19                     ` Robert Pluim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2zhbw3cha.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=40343@debbugs.gnu.org \
    --cc=kzhr@d1.dion.ne.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).