From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: netsec 682578f 4/6: Add option to bypass NSM TLS checks on local networks Date: Mon, 16 Jul 2018 18:00:11 +0300 Message-ID: <83tvoz8bus.fsf@gnu.org> References: <20180714170806.8972.58581@vcs0.savannah.gnu.org> <20180714170809.C3A3920456@vcs0.savannah.gnu.org> <87o9f84t89.fsf@gmail.com> <4C758D1D-7C3A-425A-852F-75E03C779E01@gmail.com> <87va9fs3ro.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1531753101 875 195.159.176.226 (16 Jul 2018 14:58:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2018 14:58:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 16 16:58:17 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ff4x6-00007r-Ha for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2018 16:58:16 +0200 Original-Received: from localhost ([::1]:52277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ff4zD-00080Y-IF for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2018 11:00:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ff4yt-0007pj-N9 for emacs-devel@gnu.org; Mon, 16 Jul 2018 11:00:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ff4yq-0000oc-LL for emacs-devel@gnu.org; Mon, 16 Jul 2018 11:00:07 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ff4yq-0000oN-Hs; Mon, 16 Jul 2018 11:00:04 -0400 Original-Received: from [176.228.60.248] (port=1924 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ff4yp-0004gM-8P; Mon, 16 Jul 2018 11:00:03 -0400 In-reply-to: <87va9fs3ro.fsf@gmail.com> (message from Robert Pluim on Mon, 16 Jul 2018 15:34:35 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:227455 Archived-At: > From: Robert Pluim > Date: Mon, 16 Jul 2018 15:34:35 +0200 > Cc: emacs-devel@gnu.org > > Eli, I see thereʼs a sys_getaddrinfo in w32.c, is something needed > to get emacs to use that on MS-Windows? No, you don't need anything special. nt/inc/socket.h redirects getaddrinfo into sys_getaddrinfo, and all our C sources see the redirection. > +DEFUN ("get-address-info", Fget_address_info, Sget_address_info, 1, 2, 0, > + doc: /* Look up ip address info of NAME. > +Optional parameter FAMILY controls whether to look up IPv4 or IPv6 > +addresses. The default of nil means look up both, symbol `ipv4' means > +IPv4 only, symbol `ipv6' mean IPv6 only. Returns a list of addresses, > +or nil if none were found. */) This doc string doesn't tell that each address is a vector or a string. > + if (EQ (family, Qipv4)) > + hints.ai_family = AF_INET; > +#ifdef AF_INET6 > + if (EQ (family, Qipv6)) > + hints.ai_family = AF_INET6; > +#endif Should we signal an error if 'ipv6' is requested on a system that doesn't support that? > + ret = getaddrinfo (SSDATA (name), NULL, &hints, &res); You should encode NAME (using ENCODE_SYSTEM), because it could include non-ASCII characters. In general, any Lisp string should be encoded before you can pass its data to a C library function. Thanks. P.S. This needs a NEWS entry, at the very least, and perhaps also an update for the ELisp manual.