From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Kazuhiro Ito Newsgroups: gmane.emacs.bugs Subject: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows Date: Tue, 31 Mar 2020 23:22:33 +0900 Message-ID: <86v9mkmwnq.wl--xmue@d1.dion.ne.jp> References: Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="106764"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL/10.8 EasyPG/1.0.0 Emacs/28.0 (x86_64-pc-cygwin) MULE/6.0 (HANACHIRUSATO) Cc: 40343@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 31 16:23:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJHnM-000Rfj-Lw for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 31 Mar 2020 16:23:12 +0200 Original-Received: from localhost ([::1]:38874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJHnL-0004K5-LU for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 31 Mar 2020 10:23:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50309) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJHnD-0004Hz-2n for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 10:23:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJHnC-0002MS-4H for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 10:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53417) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJHnC-0002MI-0e for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 10:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jJHnB-0005al-RE for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 10:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kazuhiro Ito Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Mar 2020 14:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40343 X-GNU-PR-Package: emacs Original-Received: via spool by 40343-submit@debbugs.gnu.org id=B40343.158566456321447 (code B ref 40343); Tue, 31 Mar 2020 14:23:01 +0000 Original-Received: (at 40343) by debbugs.gnu.org; 31 Mar 2020 14:22:43 +0000 Original-Received: from localhost ([127.0.0.1]:36730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJHms-0005Zr-OH for submit@debbugs.gnu.org; Tue, 31 Mar 2020 10:22:42 -0400 Original-Received: from snd00006.auone-net.jp ([111.86.247.6]:63488 helo=dmta0008.auone-net.jp) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJHmp-0005Zc-41 for 40343@debbugs.gnu.org; Tue, 31 Mar 2020 10:22:41 -0400 Original-Received: from kzhr.d1.dion.ne.jp by dmta0008.auone-net.jp with ESMTP id <20200331142235577.PGUL.12092.kzhr.d1.dion.ne.jp@dmta0008.auone-net.jp>; Tue, 31 Mar 2020 23:22:35 +0900 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177912 Archived-At: > 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