bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows


From: Kazuhiro Ito
Subject: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows
Date: Tue, 31 Mar 2020 23:22:33 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/28.0 (x86_64-pc-cygwin) MULE/6.0 (HANACHIRUSATO)

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

I needed to modify your regexp as below.  Additionally, I have
question that whether we should consider the case nslookup doesn't
return DNS server address, i.e. the case that re-search-forward didn't
match anything.  In that case, (match-string 1) at next line returns
inconstant value.  But according to docstring of dns-set-servers,
dns-servers should be set to nil.

diff --git a/lisp/net/dns.el b/lisp/net/dns.el
index 78d4827162..92db9a5bac 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))))

-- 
Kazuhiro Ito





reply via email to

[Prev in Thread] Current Thread [Next in Thread]