From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 31 04:47:03 2020 Received: (at submit) by debbugs.gnu.org; 31 Mar 2020 08:47:03 +0000 Received: from localhost ([127.0.0.1]:35488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJCY3-0003pf-5E for submit@debbugs.gnu.org; Tue, 31 Mar 2020 04:47:03 -0400 Received: from lists.gnu.org ([209.51.188.17]:43954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJCY1-0003pC-BN for submit@debbugs.gnu.org; Tue, 31 Mar 2020 04:47:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59128) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJCY0-0003JW-7L for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 04:47:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJCXx-00025R-GF for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 04:46:58 -0400 Received: from snd00005.auone-net.jp ([111.86.247.5]:15648 helo=dmta0001.auone-net.jp) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jJCXw-0001xk-W9 for bug-gnu-emacs@gnu.org; Tue, 31 Mar 2020 04:46:57 -0400 Received: from kzhr.d1.dion.ne.jp by dmta0001.auone-net.jp with ESMTP id <20200331084649771.PAEA.91868.kzhr.d1.dion.ne.jp@dmta0001.auone-net.jp>; Tue, 31 Mar 2020 17:46:49 +0900 Date: Tue, 31 Mar 2020 17:46:47 +0900 Message-ID: From: Kazuhiro Ito To: bug-gnu-emacs@gnu.org Subject: 28.0.50; dns-set-servers fails on IPv6 available Windows X-Hashcash: 1:20:200331:bug-gnu-emacs@gnu.org::bupCkVKEPPro7DOf:000000000000000000000000000000000000000056rZ User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/28.0 (x86_64-w64-mingw32) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-2022-JP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 111.86.247.5 X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) dns-set-servers function fails to set dns-servers on Windows with IPv6 available network. (progn (require 'dns) (dns-set-servers) dns-servers) -> (nil) The reason is that Windows's nslookup program returns server's IPv6 address if availeble but dns-set-servers function assumes that server's address is always IPv4. > C:\>nslookup localhost > サーバー: server.lan > Address: xxxx:xxxx:xxxx::1 > > 名前: localhost.lan > Addresses: ::1 > 127.0.0.1 # "サーバー" and "名前" are Japanese translations for "Server" and # "Name", respectively. From dns-set-servers definition in lisp/net/dns.el > (re-search-forward > "^Address:[ \t]*\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)" nil t) -- Kazuhiro Ito From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 31 05:51:08 2020 Received: (at 40343) by debbugs.gnu.org; 31 Mar 2020 09:51:08 +0000 Received: from localhost ([127.0.0.1]:35560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJDY3-0000Ux-Pl for submit@debbugs.gnu.org; Tue, 31 Mar 2020 05:51:07 -0400 Received: from mail-wr1-f44.google.com ([209.85.221.44]:44335) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJDXy-0000UQ-B5 for 40343@debbugs.gnu.org; Tue, 31 Mar 2020 05:51:06 -0400 Received: by mail-wr1-f44.google.com with SMTP id m17so25032193wrw.11 for <40343@debbugs.gnu.org>; Tue, 31 Mar 2020 02:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=LTF6VgDBUG2Wtw0OnpVAQLV14+cdDKcN4MimLNguIAE=; b=rhEkmYAHb3pC3t5KqQiuCzKQJGpc9oedSX09T55outHQj1AI1Y3Hy7/Hr3o+TyWvB2 YO4shXJQ2u9Dl7WHqsb6GtG2jvemNVIfI+C8Ve2yHwCZBM1ThuqHzk2HSyPnUAFxQTkj SpovJkIcVwGfwl5LBiyh2GWOHm4OUFwrwWlM7lXVWC4hgEdW/ObnGfs26VlwWVSEnyLG TOrE3iWSxRqFDHvtmyiO+9pIRpQ2LP22eEPRWx94lvVdQdF7zCzW+RyLdSA2V9GxHRxG VCqXvQ4T1ivXR3nMa3/GyUT+GdEsoiQNWV08OyldW8Ns3DrfyNtLnA0O2VL8S2sDJbjK fhIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=LTF6VgDBUG2Wtw0OnpVAQLV14+cdDKcN4MimLNguIAE=; b=hzzqBUGX0vuxHpsKzemQWKP7HUKCsKSSXYEevwpxGb/NPWGBo72+AFQ7pheMOQZpCC nXKQOj0gpRaQN/8wa8zSTYsoO7HvUi7nzxL3k1grtXRvGmSccEMuJ08zHHsI1k3K9lCl GF/ABGZdLhxZpKoVjU3cil9fyATyx9DcUI+7M+8MvySJK+vAxc6EXgJbWqKsclvlFyqd FKKZwhmlpCTb53Y35a6e68yleDTnWAJQLXiEWxQvil0ymDTkzZkrWTSXMvj460U9lKSs IQlps3pSNVRHmAhQqIuur8DMnxrPmllGRCSmDzyWrdumXCU9nykPnA5CabWsxlLHnIY6 dsbQ== X-Gm-Message-State: ANhLgQ0X5V0cAi//Zpu63fJ74v7XsJpyxJylaAZbUZmiwn6VdleH5EzW wx+0k8uVECOvnzqoqURDm+q896iK X-Google-Smtp-Source: ADFU+vuVYkl+3sUgPxJJwQeLsuvLoBKVEP7mIw2QXg+Q+zXFlvpQOZY/kapPgT9z2O55uaFvOMlOKA== X-Received: by 2002:adf:ef51:: with SMTP id c17mr19328577wrp.130.1585648256092; Tue, 31 Mar 2020 02:50:56 -0700 (PDT) Received: from rpluim-mac ([2a01:e34:ecfc:a860:65f2:9a92:2c96:9204]) by smtp.gmail.com with ESMTPSA id a64sm3161151wmh.39.2020.03.31.02.50.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 02:50:55 -0700 (PDT) From: Robert Pluim To: Kazuhiro Ito Subject: Re: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows References: Date: Tue, 31 Mar 2020 11:50:54 +0200 In-Reply-To: (Kazuhiro Ito's message of "Tue, 31 Mar 2020 17:46:47 +0900") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40343 Cc: 40343@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Tue, 31 Mar 2020 17:46:47 +0900, Kazuhiro Ito = 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=CA=BCt going to work on Windows anyway, since Emacs doesn=CA=BCt support UDP network processes on Windows. You can use 'network-lookup-address-info' (builtin) or 'nslookup-host' (from net-utils.el) instead. Kazuhiro> From dns-set-servers definition in lisp/net/dns.el >> (re-search-forward >> "^Address:[ \t]*\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)" nil t) That could be fixed, I suppose. Robert From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 31 07:06:59 2020 Received: (at 40343) by debbugs.gnu.org; 31 Mar 2020 11:06:59 +0000 Received: from localhost ([127.0.0.1]:35611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJEjT-0004cF-De for submit@debbugs.gnu.org; Tue, 31 Mar 2020 07:06:59 -0400 Received: from snd00003.auone-net.jp ([111.86.247.3]:5441 helo=dmta0002.auone-net.jp) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJEjQ-0004by-AD for 40343@debbugs.gnu.org; Tue, 31 Mar 2020 07:06:58 -0400 Received: from kzhr.d1.dion.ne.jp by dmta0002.auone-net.jp with ESMTP id <20200331110652803.PCRS.69332.kzhr.d1.dion.ne.jp@dmta0002.auone-net.jp>; Tue, 31 Mar 2020 20:06:52 +0900 Date: Tue, 31 Mar 2020 20:06:50 +0900 Message-ID: From: Kazuhiro Ito To: Robert Pluim Subject: Re: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/28.0 (x86_64-pc-cygwin) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 40343 Cc: 40343@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Kazuhiro> dns-set-servers function fails to set dns-servers on Window= s with IPv6 > Kazuhiro> available network. >=20 > Kazuhiro> (progn > Kazuhiro> (require 'dns) > Kazuhiro> (dns-set-servers) > Kazuhiro> dns-servers) >=20 > -> (nil) >=20 > dns.el isn=CA=BCt going to work on Windows anyway, since Emacs doesn=CA= =BCt > support UDP network processes on Windows. Cygwin's Emacs, which seems to support UDP network processes, uses Windows's nslookup.exe, so has this problem too. =20 # Actually I don't directly use dns.el. It is gravatar.el which uses # dns.el. --=20 Kazuhiro Ito From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 31 09:01:17 2020 Received: (at 40343) by debbugs.gnu.org; 31 Mar 2020 13:01:17 +0000 Received: from localhost ([127.0.0.1]:35725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJGW4-0002Tv-FV for submit@debbugs.gnu.org; Tue, 31 Mar 2020 09:01:16 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:52991) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJGW2-0002T9-17 for 40343@debbugs.gnu.org; Tue, 31 Mar 2020 09:01:14 -0400 Received: by mail-wm1-f52.google.com with SMTP id 11so1233085wmi.2 for <40343@debbugs.gnu.org>; Tue, 31 Mar 2020 06:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=+rkdTH1Yx1GMl3qIUmAwdTKrJMLt90sWB1xQTXo96IU=; b=ZtmM5UpU+ac6YBq71c9xIzD9zYL890fICMnK8tPj9E4C85LG/v8cv1tAtJXkoxCKlX NmRLkQcZJ9TZAZNnfc+qJNjV5qSZsh+cHmcUCqIgEmbHEGoA1wm1MP419DdHXH0PBySM C3kr7AFzWJRGR7CCfEb6sTgrgI4m0OVWtmjS2PbyOP0pdSGT7OEjUewCypWSTwV3sPAz gA1Jh8IkLJ93kOOZ1Rc2teHPb2iWbZIdutr2M6Ep3XWuah5rlUq17uLBtb6YCU0kxWS4 LRxEuj1iLSMRsepB908ZPY5DZcYs1VMK53WenDEor3mg9Kg/eTY9ZDn1o382OOOfCIbr exiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=+rkdTH1Yx1GMl3qIUmAwdTKrJMLt90sWB1xQTXo96IU=; b=G3Fl+1m3J3zdtTruo97oBbV0waQFGl0N+w2PfSErGVSkA4jrVaB0i+HnhJia+G6+Jf F16tCMLJ0YusMLfSuNoa2IUThk8ay4HW/dJ00ED0+Fx3hx/ZirmDIXqsH1ngpdGWzylY 7oi29eq9Hz1kdCPi7vceQVLT/fn/a/7wNbrHfT7BAxZ2o7YFiiekSF5rb0AlBRtnA4Tf 21NTXoITC4+Cz4P9GXE300OYLEQdFAYf96EKa3FLtPS1bJR5GD3NJUF7NDd655Bi58po Wl1PDLOBjxGWSCQIjc5t5CIliRdat4KfvS9TzfETLSikp+77K3zjrPIbT412J8PdWnO2 wMVg== X-Gm-Message-State: ANhLgQ0Q9jvbZZF2tO+JqUK51t1+qibuy0NzXidIEQE32jRcwq+uRmDj kq30UV7sKk13kgfH8WpXy4cJQrBk X-Google-Smtp-Source: ADFU+vvDyH9bYdFDMYH9V4XIT1QqZfb8+FzIFvLMDnN1zEF7yX27ZSuJ29me3pgD77PNdOfHqpo5Rw== X-Received: by 2002:a1c:6745:: with SMTP id b66mr3411424wmc.30.1585659667771; Tue, 31 Mar 2020 06:01:07 -0700 (PDT) Received: from rpluim-mac ([2a01:e34:ecfc:a860:65f2:9a92:2c96:9204]) by smtp.gmail.com with ESMTPSA id k3sm3768842wmf.16.2020.03.31.06.01.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 06:01:06 -0700 (PDT) From: Robert Pluim To: Kazuhiro Ito Subject: Re: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows References: Date: Tue, 31 Mar 2020 15:01:05 +0200 In-Reply-To: (Kazuhiro Ito's message of "Tue, 31 Mar 2020 20:06:50 +0900") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40343 Cc: 40343@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Tue, 31 Mar 2020 20:06:50 +0900, Kazuhiro Ito = said: Kazuhiro> dns-set-servers function fails to set dns-servers on Windows = with IPv6 Kazuhiro> available network. >>=20 Kazuhiro> (progn Kazuhiro> (require 'dns) Kazuhiro> (dns-set-servers) Kazuhiro> dns-servers) >>=20 -> (nil) >>=20 >> dns.el isn=CA=BCt going to work on Windows anyway, since Emacs doesn= =CA=BCt >> 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.=20=20 That=CA=BCs not a Windows Emacs :-) Kazuhiro> # Actually I don't directly use dns.el. It is gravatar.el wh= ich 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)))) From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 31 10:22:43 2020 Received: (at 40343) by debbugs.gnu.org; 31 Mar 2020 14:22:43 +0000 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 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 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 Date: Tue, 31 Mar 2020 23:22:33 +0900 Message-ID: <86v9mkmwnq.wl--xmue@d1.dion.ne.jp> From: Kazuhiro Ito To: Robert Pluim Subject: Re: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/28.0 (x86_64-pc-cygwin) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 40343 Cc: 40343@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 31 10:28:47 2020 Received: (at 40343) by debbugs.gnu.org; 31 Mar 2020 14:28:47 +0000 Received: from localhost ([127.0.0.1]:36740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJHsk-0005kQ-Rg for submit@debbugs.gnu.org; Tue, 31 Mar 2020 10:28:47 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:44311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJHsi-0005kC-DW for 40343@debbugs.gnu.org; Tue, 31 Mar 2020 10:28:45 -0400 Received: by mail-wr1-f53.google.com with SMTP id m17so26203004wrw.11 for <40343@debbugs.gnu.org>; Tue, 31 Mar 2020 07:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=8GUAKmGeM9eFTw2O2ZNa2up5lT8j62DdNQ2svPLYPvs=; b=okTSxhFCRCqf8I3ebWyUC971dPQuU7hQ45qNz92iI6MTzREaolpp7EKDHrsAl85XoX yjGiXCh3kkU0dVMQyD+MgJca7+xRbGmo3tSSKq1pvUEiQgjIlFu02eOHl1trRVuMlkBH ijNqRmkmSEsfjXw1NQ3WNT4WMNWuioSy6tmE/aY/kmCATR/CyW//Fn81PLzNksKcN7uU 37yEbAdhj+Wf58sLZVAIXmdDu4AW/rAFsFYVuobBatil/L05mOfMqTa3Xc8DOEb0SFW6 94MMHSd+aAPsjCVnnZO+JafGsULcstkCbn8evhPjjjMyKRrlrM4890ZQ1iYbFQs1BSut 7ooQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=8GUAKmGeM9eFTw2O2ZNa2up5lT8j62DdNQ2svPLYPvs=; b=rA0tzJgPq/rmjd71qrP4QC97BXaBNmiu47sUkZUvk7XArws7n974Ffqto7zi3h9nn8 4eFmjYLHW3FU4GTREgY4VsXYlO2wTgxi/iaTg7M3Vyiro5D2eqSqASPuJCLysRuGsrmD JFzwJbQ6UIGKQXqeARXjPKw6rC24hNQDAfDkCood33zIgekq9UROeTftSRGvTCa+1lkj ZNaOgV1AjXKwbeXiiS0zSBCpiF5vINW4Jd/A3n/9QwI9SXgXJIy3Cny7UkfAdB94F698 vTmUI+SSwF2fwmt7/0YZtXdwhcMDAlnLiy4qlygKzPuaWLaqjtxqAI2pbLDw3rczskgG CoMA== X-Gm-Message-State: ANhLgQ3H4d1YgDulhJWRpwkRnfwW0HyT99t/fyXc+8uKq0jp3PyQCZTA aWc7QIIRJB31PU6IlfzyQSuJ+xc2 X-Google-Smtp-Source: ADFU+vuCTTxJiuLYPjDF0AMcWJJjUqV/I/SpMJvSo9sB1f5X/oWj1ihcC7rKmdpcUPgXV7jXsLYE5A== X-Received: by 2002:adf:a35a:: with SMTP id d26mr21587101wrb.185.1585664918250; Tue, 31 Mar 2020 07:28:38 -0700 (PDT) Received: from rpluim-mac ([2a01:e34:ecfc:a860:65f2:9a92:2c96:9204]) by smtp.gmail.com with ESMTPSA id s9sm4386103wmc.2.2020.03.31.07.28.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 07:28:37 -0700 (PDT) From: Robert Pluim To: Kazuhiro Ito Subject: Re: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows References: <86v9mkmwnq.wl--xmue@d1.dion.ne.jp> Date: Tue, 31 Mar 2020 16:28:36 +0200 In-Reply-To: <86v9mkmwnq.wl--xmue@d1.dion.ne.jp> (Kazuhiro Ito's message of "Tue, 31 Mar 2020 23:22:33 +0900") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40343 Cc: 40343@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Tue, 31 Mar 2020 23:22:33 +0900, Kazuhiro Ito = said: >> Does this work for you: >>=20 >> 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)))) Kazuhiro> I needed to modify your regexp as below. Ah yes, I got the grouping wrong. Kazuhiro> Additionally, I have Kazuhiro> question that whether we should consider the case nslookup do= esn't Kazuhiro> return DNS server address, i.e. the case that re-search-forwa= rd didn't Kazuhiro> match anything. In that case, (match-string 1) at next line = returns Kazuhiro> inconstant value. But according to docstring of dns-set-serv= ers, Kazuhiro> dns-servers should be set to nil. The dns lookup will fail in either case, no? So I=CA=BCm not sure it really matters. Robert From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 01 09:43:30 2020 Received: (at 40343) by debbugs.gnu.org; 1 Apr 2020 13:43:30 +0000 Received: from localhost ([127.0.0.1]:37620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJdeU-0001kv-Hi for submit@debbugs.gnu.org; Wed, 01 Apr 2020 09:43:30 -0400 Received: from snd00002.auone-net.jp ([111.86.247.2]:50881 helo=dmta0002.auone-net.jp) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJdeQ-0001kR-In for 40343@debbugs.gnu.org; Wed, 01 Apr 2020 09:43:28 -0400 Received: from kzhr.d1.dion.ne.jp by dmta0002.auone-net.jp with ESMTP id <20200401134321405.QRRV.69332.kzhr.d1.dion.ne.jp@dmta0002.auone-net.jp>; Wed, 1 Apr 2020 22:43:21 +0900 Date: Wed, 01 Apr 2020 22:43:20 +0900 Message-ID: <86zhbvxqx3.wl--xmue@d1.dion.ne.jp> From: Kazuhiro Ito To: Robert Pluim Subject: Re: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows In-Reply-To: References: <86v9mkmwnq.wl--xmue@d1.dion.ne.jp> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/28.0 (x86_64-w64-mingw32) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 40343 Cc: 40343@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Kazuhiro> Additionally, I have > Kazuhiro> question that whether we should consider the case nslookup = doesn't > Kazuhiro> return DNS server address, i.e. the case that re-search-for= ward didn't > Kazuhiro> match anything. In that case, (match-string 1) at next lin= e returns > Kazuhiro> inconstant value. But according to docstring of dns-set-se= rvers, > Kazuhiro> dns-servers should be set to nil. >=20 > The dns lookup will fail in either case, no? So I=CA=BCm not sure it real= ly > matters. For example, when I tested on my standalone Debian (sid) box, evaluating the below code just after starting Emacs returns annoying result. (progn (require 'dns) (dns-set-servers) dns-servers) -> ("c") We need to validate dns-servers's value to judge whether dns-set-servers succeeded contorary docstring of dns-set-servers, which says dns-servers is non-nil when dns-set-servers succeeded. I think docstring or actual behavior of dns-set-servers should be fixed. I noticed another problem in dns.el. dns-query function returns message's string ("No DNS server configuration found") when dns-servers is nil. --=20 Kazuhiro Ito From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 01 09:58:01 2020 Received: (at 40343) by debbugs.gnu.org; 1 Apr 2020 13:58:01 +0000 Received: from localhost ([127.0.0.1]:38500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJdsW-0002kQ-OX for submit@debbugs.gnu.org; Wed, 01 Apr 2020 09:58:01 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39223) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJdsU-0002jt-4E for 40343@debbugs.gnu.org; Wed, 01 Apr 2020 09:57:58 -0400 Received: by mail-wr1-f68.google.com with SMTP id p10so146960wrt.6 for <40343@debbugs.gnu.org>; Wed, 01 Apr 2020 06:57:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=Kkb+hJFlVmkAxwkx/YO+7FATtLo0OfoHsgysyogke1s=; b=fCoxroeGjWymYu+XU0HPlXMMJAsdm4Wy2F3Dh65Eg7BBGFLt0h5iNXBhUXRLUlJ+Lu Uw7OmSK7PAdTCVLpA0GsEQ+IjZcZbeiMNh6jZnLbH63R6QneRNyS5ecLrSIFQfohG9cS tzS5JlLcEqbgVy/MlStJN4VwZJdJOA2LdURbjTOrHaj2qYXqxP81/UAVG/jHWvM6IppD 0KGvhezOs0Cwwd8NF5+LqZaS07YGJ5SC5NkMJ3YqOR7WWZvVcNl6fe/xrwzs++W+sz3z ObZICeX7dKzCIR74LArLJltV5YRasjencGhmbxEG1/uBFAVIeDJ60kdTMIu9QcIafzMY 6sAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=Kkb+hJFlVmkAxwkx/YO+7FATtLo0OfoHsgysyogke1s=; b=UkQbzTpvN9ivWoWU0g1/LZ4el454tunUf3fieri5cUA5yka5TIuFHjyhW0n4GEGkZs CjAccX8ZMJi1dZaGqESgMOPf2MqfjpB+6j10jXY45zLrNxg6coJvYw/yt3/lhIStK2uJ WLvK4fB9hf99rPhCbTgsYOHBjzZ48KLxpiyTJvPduoQxwI7Z9x6Gzvnfr+bFr/Q/XW1n iJqqffCW08Dpz2r+hLHY2rZG2mdYTUO+9mRnrMEXI4fweHP+zHetcOzTipUtcGfJae65 pIMzINOrrAZAN2Y9G30KSwzD8qsxVTFgiHbwElK0Lop7dfHToD0jrWcINSUV3cvUU3k+ GFuA== X-Gm-Message-State: ANhLgQ3suag3rieAYNsysBeacShtazmnFQg1g2CXlvy4myMW3+htcdyG wIkVaxgFKdp0bZrAbKfV8gYB8g77 X-Google-Smtp-Source: ADFU+vuWsdFYBBaAQ11hYMw1HaZDZMz7XhJzcvV/Dbvak+SCQg05omd7ayae5VFiiFka5zS59+zJZQ== X-Received: by 2002:a5d:4d51:: with SMTP id a17mr24042043wru.317.1585749471669; Wed, 01 Apr 2020 06:57:51 -0700 (PDT) Received: from rpluim-mac ([2a01:e34:ecfc:a860:65f2:9a92:2c96:9204]) by smtp.gmail.com with ESMTPSA id o67sm2895044wmo.5.2020.04.01.06.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2020 06:57:51 -0700 (PDT) From: Robert Pluim To: Kazuhiro Ito Subject: Re: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows References: <86v9mkmwnq.wl--xmue@d1.dion.ne.jp> <86zhbvxqx3.wl--xmue@d1.dion.ne.jp> Date: Wed, 01 Apr 2020 15:57:50 +0200 In-Reply-To: <86zhbvxqx3.wl--xmue@d1.dion.ne.jp> (Kazuhiro Ito's message of "Wed, 01 Apr 2020 22:43:20 +0900") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40343 Cc: 40343@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Wed, 01 Apr 2020 22:43:20 +0900, Kazuhiro Ito = said: Kazuhiro> Additionally, I have Kazuhiro> question that whether we should consider the case nslookup do= esn't Kazuhiro> return DNS server address, i.e. the case that re-search-forwa= rd didn't Kazuhiro> match anything. In that case, (match-string 1) at next line = returns Kazuhiro> inconstant value. But according to docstring of dns-set-serv= ers, Kazuhiro> dns-servers should be set to nil. >>=20 >> The dns lookup will fail in either case, no? So I=CA=BCm not sure it= really >> matters. Kazuhiro> For example, when I tested on my standalone Debian (sid) box, Kazuhiro> evaluating the below code just after starting Emacs returns a= nnoying Kazuhiro> result. Kazuhiro> (progn Kazuhiro> (require 'dns) Kazuhiro> (dns-set-servers) Kazuhiro> dns-servers) -> ("c") Yes, but the API exposed by dns.el is 'dns-query' (and maybe 'dns-query-cached'). 'dns-set-servers' should probably be called 'dns--set-servers' to indicate that it=CA=BCs an internal function. Kazuhiro> We need to validate dns-servers's value to judge whether Kazuhiro> dns-set-servers succeeded contorary docstring of dns-set-serv= ers, Kazuhiro> which says dns-servers is non-nil when dns-set-servers succee= ded. I Kazuhiro> think docstring or actual behavior of dns-set-servers should = be fixed. See previous paragraph: it=CA=BCs an internal function. Kazuhiro> I noticed another problem in dns.el. dns-query function retu= rns Kazuhiro> message's string ("No DNS server configuration found") when Kazuhiro> dns-servers is nil. Yes, it should probably return nil, and this is actually a valid reason for why 'dns-set-servers' should set dns-servers to nil on failure. Can you determine why it=CA=BCs failing on your Debian box? Robert From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 01 10:55:21 2020 Received: (at 40343) by debbugs.gnu.org; 1 Apr 2020 14:55:21 +0000 Received: from localhost ([127.0.0.1]:38563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJem1-00084q-DC for submit@debbugs.gnu.org; Wed, 01 Apr 2020 10:55:21 -0400 Received: from snd00006.auone-net.jp ([111.86.247.6]:25025 helo=dmta0009.auone-net.jp) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJelx-00084S-VF for 40343@debbugs.gnu.org; Wed, 01 Apr 2020 10:55:20 -0400 Received: from kzhr.d1.dion.ne.jp by dmta0009.auone-net.jp with ESMTP id <20200401145512693.QMWG.46504.kzhr.d1.dion.ne.jp@dmta0009.auone-net.jp>; Wed, 1 Apr 2020 23:55:12 +0900 Date: Wed, 01 Apr 2020 23:55:12 +0900 Message-ID: From: Kazuhiro Ito To: Robert Pluim Subject: Re: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows In-Reply-To: References: <86v9mkmwnq.wl--xmue@d1.dion.ne.jp> <86zhbvxqx3.wl--xmue@d1.dion.ne.jp> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/28.0 (x86_64-pc-cygwin) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 40343 Cc: 40343@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Kazuhiro> For example, when I tested on my standalone Debian (sid) bo= x, > Kazuhiro> evaluating the below code just after starting Emacs returns= annoying > Kazuhiro> result. >=20 > Kazuhiro> (progn > Kazuhiro> (require 'dns) > Kazuhiro> (dns-set-servers) > Kazuhiro> dns-servers) >=20 > -> ("c") >=20 > Yes, but the API exposed by dns.el is 'dns-query' (and maybe > 'dns-query-cached'). 'dns-set-servers' should probably be called > 'dns--set-servers' to indicate that it=CA=BCs an internal function. >=20 > Kazuhiro> We need to validate dns-servers's value to judge whether > Kazuhiro> dns-set-servers succeeded contorary docstring of dns-set-se= rvers, > Kazuhiro> which says dns-servers is non-nil when dns-set-servers succ= eeded. I > Kazuhiro> think docstring or actual behavior of dns-set-servers shoul= d be fixed. >=20 > See previous paragraph: it=CA=BCs an internal function. I don't understand what you mean by "it=CA=BCs an internal function". I don't think it is okay that internal functions don't behave as described in docstring. > Kazuhiro> I noticed another problem in dns.el. dns-query function re= turns > Kazuhiro> message's string ("No DNS server configuration found") when > Kazuhiro> dns-servers is nil. >=20 > Yes, it should probably return nil, and this is actually a valid > reason for why 'dns-set-servers' should set dns-servers to nil on > failure. Can you determine why it=CA=BCs failing on your Debian box? I tested on Debian box as below. 1. /etc/init.d/networking stop 2. remove nameserver entry from /etc/resolv.conf On such condition, nslookup program outputs as below > ;; connection timed out; no servers could be reached Here is code snippet communicating with nslookup in dns-set-servers. > (with-temp-buffer > (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) > (setq dns-servers (list (match-string 1)))) On the above condition, re-search-forward doesn't match anything. But next match-string is called unconditionally. As far as I tested, match-string's result when last search didn't match is undefined. it may return nil, string or raise an error. Additionally, even if match-string returns nil, dns-servers is never set to nil. It is set to (nil). --=20 Kazuhiro Ito From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 03 04:42:34 2020 Received: (at 40343) by debbugs.gnu.org; 3 Apr 2020 08:42:34 +0000 Received: from localhost ([127.0.0.1]:41150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKHuM-0003cB-BM for submit@debbugs.gnu.org; Fri, 03 Apr 2020 04:42:34 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:35187) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKHuK-0003bf-96 for 40343@debbugs.gnu.org; Fri, 03 Apr 2020 04:42:33 -0400 Received: by mail-wr1-f45.google.com with SMTP id g3so5197758wrx.2 for <40343@debbugs.gnu.org>; Fri, 03 Apr 2020 01:42:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:message-id:mime-version; bh=MBU0pcKxcXgydUtyBSFRjJpRd11dBsH6HB4fnPYdShg=; b=FhzugNcQ8nUq+n0y6DxR7l7Eftyj2jtsO3g+wTuM2sBsdTY2vfjyiWlHq/v56es6HL CztaY34i3itlrWmnGe03mnObNRtw5k9h19Z3woG2qm7QHOYL/Wbl3nl/tKNdwessuYu0 6aNheH8Bu4QceA2uEM4jhO8J3UBjT3PBv/o7xac2oHXRNlxuRQw34V3vgKkYnQLZfOnd fyUikTtpqhwqT96QSxwrjXcds8IgHOZggRVb4kH51/3a3m2zunCDrwWWNOp5lyOZXttP 6P95JHBP0LFWBx1F6XPes9aDUn91L0h+fFPtUvJkY/nefPNmAbvqTmpMbFLi0DokAtUm zeXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:message-id :mime-version; bh=MBU0pcKxcXgydUtyBSFRjJpRd11dBsH6HB4fnPYdShg=; b=LMV47lM2Vhli40JBbUcvg96akJGjjFpAlezWkGiQo0P9vor2Vr0cqCTy3SeFef36ov ItCTr1Y8b1zcCts2TrfwYsxEMhjmmz7BWv+lm4XxJPx4Q5Usp4o01AE5JtDd/anGGVbV ykOH4Zg1hL058lcMxRwrAi2RJ8qBhS3xR/h3P+N7wKcyU6RgbylKyoc9hH6pXeNS5yrQ 36ndihMKrZfV50BYQOrdl/Guaw38jRhjfPPfgcYnvd79C8I88AhyGlVteQJTFK+GN4ku 6n2mEVV5zaWYILvBB/gaqVMBSoNUkZhYOCDZTEEfdH526FLd9lOFi2wUQRs7mWXpRMu/ /b2g== X-Gm-Message-State: AGi0PuYVNIIvZP1v4bxXLLeNoM5o712TrfgsfX7Ti56sXsJqOse+0+PX /Q21dLmSK7IlLYlt1GxnHu0HweB6 X-Google-Smtp-Source: APiQypKoyWTprx+9TtiK4H8dQQ7YInPsgYvMUssMo3KEfjAt0y4QWiFKwVlY/kHMU0egWWhvmps5QA== X-Received: by 2002:adf:fd47:: with SMTP id h7mr7715150wrs.105.1585903345917; Fri, 03 Apr 2020 01:42:25 -0700 (PDT) Received: from rpluim-mac ([2a01:e34:ecfc:a860:30c1:b817:7653:c738]) by smtp.gmail.com with ESMTPSA id i97sm6304535wri.1.2020.04.03.01.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 01:42:25 -0700 (PDT) From: Robert Pluim To: Kazuhiro Ito Subject: Re: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows References: <86v9mkmwnq.wl--xmue@d1.dion.ne.jp> <86zhbvxqx3.wl--xmue@d1.dion.ne.jp> Date: Fri, 03 Apr 2020 10:42:24 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40343 Cc: 40343@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Wed, 01 Apr 2020 23:55:12 +0900, Kazuhiro Ito said: Kazuhiro> I tested on Debian box as below. Kazuhiro> 1. /etc/init.d/networking stop Kazuhiro> 2. remove nameserver entry from /etc/resolv.conf Kazuhiro> On such condition, nslookup program outputs as below >> ;; connection timed out; no servers could be reached Kazuhiro> Here is code snippet communicating with nslookup in dns-set-servers. >> (with-temp-buffer >> (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) >> (setq dns-servers (list (match-string 1)))) Kazuhiro> On the above condition, re-search-forward doesn't match anything. But Kazuhiro> next match-string is called unconditionally. As far as I tested, Kazuhiro> match-string's result when last search didn't match is undefined. it Kazuhiro> may return nil, string or raise an error. Additionally, even if Kazuhiro> match-string returns nil, dns-servers is never set to nil. It is set Kazuhiro> to (nil). Thanks for that. This should fix all those cases: diff --git a/lisp/net/dns.el b/lisp/net/dns.el index 78d4827162..177df4e332 100644 --- a/lisp/net/dns.el +++ b/lisp/net/dns.el @@ -315,8 +315,8 @@ dns-servers-up-to-date-p (defun dns-set-servers () "Set `dns-servers' to a list of DNS servers or nil if none are found. Parses \"/etc/resolv.conf\" or calls \"nslookup\"." + (setq dns-servers nil) (or (when (file-exists-p "/etc/resolv.conf") - (setq dns-servers nil) (with-temp-buffer (insert-file-contents "/etc/resolv.conf") (goto-char (point-min)) @@ -327,9 +327,9 @@ dns-set-servers (with-temp-buffer (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) - (setq dns-servers (list (match-string 1)))))) + (when (re-search-forward + "^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)))) @@ -357,7 +357,9 @@ dns-make-network-process `(let ((server ,server) (coding-system-for-read 'binary) (coding-system-for-write 'binary)) - (if (fboundp 'make-network-process) + (if (and + (fboundp 'make-network-process) + (featurep 'make-network-process '(:type datagram))) (make-network-process :name "dns" :coding 'binary @@ -365,9 +367,9 @@ dns-make-network-process :host server :service "domain" :type 'datagram) - ;; Older versions of Emacs doesn't have - ;; `make-network-process', so we fall back on opening a TCP - ;; connection to the DNS server. + ;; Older versions of Emacs do not have `make-network-process', + ;; and on MS-Windows datagram sockets are not supported, so we + ;; fall back on opening a TCP connection to the DNS server. (open-network-stream "dns" (current-buffer) server "domain")))) (defvar dns-cache (make-vector 4096 0)) @@ -400,7 +402,9 @@ dns-query type 'PTR)) (if (not dns-servers) - (message "No DNS server configuration found") + (progn + (message "No DNS server configuration found") + nil) (with-temp-buffer (set-buffer-multibyte nil) (let ((process (condition-case () From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 03 10:08:23 2020 Received: (at 40343) by debbugs.gnu.org; 3 Apr 2020 14:08:23 +0000 Received: from localhost ([127.0.0.1]:42980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKMze-0004lT-HC for submit@debbugs.gnu.org; Fri, 03 Apr 2020 10:08:22 -0400 Received: from snd00002.auone-net.jp ([111.86.247.2]:3297 helo=dmta0006.auone-net.jp) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKMza-0004l0-8p for 40343@debbugs.gnu.org; Fri, 03 Apr 2020 10:08:20 -0400 Received: from kzhr.d1.dion.ne.jp by dmta0006.auone-net.jp with ESMTP id <20200403140815492.TMIB.121622.kzhr.d1.dion.ne.jp@dmta0006.auone-net.jp>; Fri, 3 Apr 2020 23:08:15 +0900 Date: Fri, 03 Apr 2020 23:08:10 +0900 Message-ID: <86v9mgbr1x.wl--xmue@d1.dion.ne.jp> From: Kazuhiro Ito To: Robert Pluim Subject: Re: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows In-Reply-To: References: <86v9mkmwnq.wl--xmue@d1.dion.ne.jp> <86zhbvxqx3.wl--xmue@d1.dion.ne.jp> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/28.0 (x86_64-w64-mingw32) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 40343 Cc: 40343@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Thanks for that. This should fix all those cases: Thank you for the patch. It works well on Cygwin environment. But I noticed different problems in dns-query when TCP is used. 1. dns-write function needs to be called with TCP-P option. 2. First 2 bytes of received data (length field) should be truncated for dns-read function. Or dns-read function should accept TCP-P option like dns-wrote function. > diff --git a/lisp/net/dns.el b/lisp/net/dns.el > index 78d4827162..177df4e332 100644 > --- a/lisp/net/dns.el > +++ b/lisp/net/dns.el > @@ -315,8 +315,8 @@ dns-servers-up-to-date-p > (defun dns-set-servers () > "Set `dns-servers' to a list of DNS servers or nil if none are found. > Parses \"/etc/resolv.conf\" or calls \"nslookup\"." > + (setq dns-servers nil) > (or (when (file-exists-p "/etc/resolv.conf") > - (setq dns-servers nil) > (with-temp-buffer > (insert-file-contents "/etc/resolv.conf") > (goto-char (point-min)) > @@ -327,9 +327,9 @@ dns-set-servers > (with-temp-buffer > (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) > - (setq dns-servers (list (match-string 1)))))) > + (when (re-search-forward > + "^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)))) > > @@ -357,7 +357,9 @@ dns-make-network-process > `(let ((server ,server) > (coding-system-for-read 'binary) > (coding-system-for-write 'binary)) > - (if (fboundp 'make-network-process) > + (if (and > + (fboundp 'make-network-process) > + (featurep 'make-network-process '(:type datagram))) > (make-network-process > :name "dns" > :coding 'binary > @@ -365,9 +367,9 @@ dns-make-network-process > :host server > :service "domain" > :type 'datagram) > - ;; Older versions of Emacs doesn't have > - ;; `make-network-process', so we fall back on opening a TCP > - ;; connection to the DNS server. > + ;; Older versions of Emacs do not have `make-network-process', > + ;; and on MS-Windows datagram sockets are not supported, so we > + ;; fall back on opening a TCP connection to the DNS server. > (open-network-stream "dns" (current-buffer) server "domain")))) > > (defvar dns-cache (make-vector 4096 0)) > @@ -400,7 +402,9 @@ dns-query > type 'PTR)) > > (if (not dns-servers) > - (message "No DNS server configuration found") > + (progn > + (message "No DNS server configuration found") > + nil) > (with-temp-buffer > (set-buffer-multibyte nil) > (let ((process (condition-case () -- Kazuhiro Ito From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 03 11:19:35 2020 Received: (at 40343-done) by debbugs.gnu.org; 3 Apr 2020 15:19:35 +0000 Received: from localhost ([127.0.0.1]:43020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKO6Z-0000Mm-6b for submit@debbugs.gnu.org; Fri, 03 Apr 2020 11:19:35 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:39820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKO6X-0000MK-0q for 40343-done@debbugs.gnu.org; Fri, 03 Apr 2020 11:19:33 -0400 Received: by mail-wr1-f43.google.com with SMTP id p10so8973431wrt.6 for <40343-done@debbugs.gnu.org>; Fri, 03 Apr 2020 08:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:message-id:mime-version :content-transfer-encoding; bh=J5uWupe7vhlBFr2WRTm/wNw2/VmiVJpnHtwqsAK1Ark=; b=o3jBF+K2/w9vIJRhyDZdlkWNeBBCdKwUd8+pV4cLwi+Ya+JfOtm3UGPzt9ENmwUB0r d8HtZzlmhk8p6MKKSHuTcr5cSzHe5pG7OFVyJmddv4bg68WB1JBaxZSXXM8t30Sa/v5r 1tsPUg8fluAfmMVSzWRD6kf7kz/TuixBvayVaDRyNlYls2fuzdurAgvkgBCD/AEpQvz0 JGuHYAIcv1SksUaumq9YNeT9RVfsIHz0fQgEM22L2Pgg5JUVS0XhR7F/yYyaBXhlIqc4 rCCxSdfHlnTH30oH2dqNsR+yz1Nta5t2vsIgJnJcuOnJMbvutu4cu4l/E3QBUt1QvG8I 4o4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:message-id :mime-version:content-transfer-encoding; bh=J5uWupe7vhlBFr2WRTm/wNw2/VmiVJpnHtwqsAK1Ark=; b=uVg9QyUEQ0nhlhjykoHwUZni+wMryy9O+OG3dVZXxh6LnLWcxg3bUfiE2Wf8zorRnH TBwWSY40bY7oNaNHtPBUr9uEBQiDxl6RMvvYDuFArPfC61BjNrFLmzanY43MXNnfwW78 g7r2AJ/rCw5X23WVUD/UKJiEd1gAdvQuSMygdH1AKlCuqZTySwxzO5JsDkC2F5NW+gDX DM0LK83xjmR4X9hj3XiWAX3Q7F1//XB5Z1thydtmAqMnml6CD6UIZA5LJF6K8WwmZnu3 UP1oZ639m6GIRMN5HlGxTuVbZaKGyocZeBtgcgmWtlL3wCOrX+Eat80ymzdYoMXpCzsN HdtA== X-Gm-Message-State: AGi0PubgnBhy4cZW4Qp40czb8m8mnOryOeyzfTZXooanQjNfk8+aSxYU j5Rh4RloPlSW7X9Eo8ndM7BfgmSO X-Google-Smtp-Source: APiQypKL8nX0ewaYp+whfRrS8cNrbj2Syf04ABwg06Cwoj+aPG5ocNTuh6rH6a9Rvr/2b+qAEXOsxA== X-Received: by 2002:a05:6000:370:: with SMTP id f16mr9961636wrf.9.1585927166712; Fri, 03 Apr 2020 08:19:26 -0700 (PDT) Received: from rpluim-mac ([2a01:e34:ecfc:a860:d87d:2087:586e:f498]) by smtp.gmail.com with ESMTPSA id x206sm11843692wmg.17.2020.04.03.08.19.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 08:19:26 -0700 (PDT) From: Robert Pluim To: Kazuhiro Ito Subject: Re: bug#40343: 28.0.50; dns-set-servers fails on IPv6 available Windows References: <86v9mkmwnq.wl--xmue@d1.dion.ne.jp> <86zhbvxqx3.wl--xmue@d1.dion.ne.jp> <86v9mgbr1x.wl--xmue@d1.dion.ne.jp> Date: Fri, 03 Apr 2020 17:19:25 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40343-done Cc: 40343-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Fri, 03 Apr 2020 23:08:10 +0900, Kazuhiro Ito = said: >> Thanks for that. This should fix all those cases: Kazuhiro> Thank you for the patch. It works well on Cygwin environment= . But I Kazuhiro> noticed different problems in dns-query when TCP is used. Thanks for checking, pushed to master as 00f7744c1b Closing the bug. Kazuhiro> 1. dns-write function needs to be called with TCP-P option. Kazuhiro> 2. First 2 bytes of received data (length field) should be tr= uncated Kazuhiro> for dns-read function. Or dns-read function should accept TC= P-P Kazuhiro> option like dns-wrote function. Indeed, looks like that=CA=BCs never worked. I=CA=BCll fix those separately. Robert From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 03 11:20:03 2020 Received: (at control) by debbugs.gnu.org; 3 Apr 2020 15:20:03 +0000 Received: from localhost ([127.0.0.1]:43027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKO71-0000PR-He for submit@debbugs.gnu.org; Fri, 03 Apr 2020 11:20:03 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:41537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKO6z-0000O9-GT for control@debbugs.gnu.org; Fri, 03 Apr 2020 11:20:01 -0400 Received: by mail-wr1-f51.google.com with SMTP id h9so8983092wrc.8 for ; Fri, 03 Apr 2020 08:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=Lv1KDx/gpHObO1XkCudujHp/yFnNIyK3KdvJIrXwfWI=; b=ifUwIE/7wE4qjgG8cja1lPjWzfBBaKaTDTd+mrAE/nBxclSBmVVtc6ZgQ9zm5eRBV6 ly+sZbp9aC30ql/XgunhMXfblwInu6C3V6KhI8YbsSYcpW6NqaG765XhE/rkVnYXbJYh BpDMn2XH4YvMIs896FNCJ2YQAeuBAW/+/49hqf82pc/Fr0ec4H52KMHe+0drsn1y8Bgg AbvOod9KVhW/Hp1/P1xWBtO4R3BAN06pC0K5uF1Ahi8LTppZFloh1KF3YI6ryPN9/8+r QKoFYJhpe9LXrCyKFT58I1nOUfim32iVG7+hKTxt8y82f3outcIrFYi2ZtgA7M+PtmGL AlpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=Lv1KDx/gpHObO1XkCudujHp/yFnNIyK3KdvJIrXwfWI=; b=hPTI1Zm/K6Fs9ZUyljTvw4iJmBoXwl7bKht81a3BB9ZUWY1jVPcH7BXpR1z60mfpe6 Bfn5xaY3ixiNeDUXMunhnuKJEU5btN2h7RKLq8ksvBitiYsVC34/rq71jBR/c4hbiAbO q5/H3yHoUXJThNdOMKZj0y553RXloND9P3F68Yxf89yQcoaRqiw8ZXkkh/WK7FtY6RtQ nr7BXY4Dwin3VILaIusnqODzN6WDBUojRwSN42oOA9Bp3wY+Iojsp32bhvIu39NJOPU3 3ik5lAbxEyt6+P6dafb2AE6SDBqT/Te0F8E+RUirpoI1mA0KzT0vZxnf+qRkG+goEhsO rS6A== X-Gm-Message-State: AGi0PubEKiGVTrJnmOataOca09np6iZeQK4CMVBQjuv4EWyiFpDiLpDt 2P/SKAGnCV+KdVKEAnXKMPwmOcp6 X-Google-Smtp-Source: APiQypKXDrO0xvum9t1EXy1eVwVXx20iwkTa/a4fH/IIb+meJj8GXBq4DB23ccDzWj9qVWxAJlaOHQ== X-Received: by 2002:adf:f808:: with SMTP id s8mr284027wrp.219.1585927195591; Fri, 03 Apr 2020 08:19:55 -0700 (PDT) Received: from rpluim-mac ([2a01:e34:ecfc:a860:d87d:2087:586e:f498]) by smtp.gmail.com with ESMTPSA id j11sm11786313wmi.33.2020.04.03.08.19.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 08:19:55 -0700 (PDT) From: Robert Pluim To: control@debbugs.gnu.org Subject: control message for bug #40343 Date: Fri, 03 Apr 2020 17:19:53 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) fixed 40343 28.1 quit From unknown Thu Aug 14 18:38:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 02 May 2020 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator