From unknown Mon Jun 23 16:46:14 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#38218 <38218@debbugs.gnu.org> To: bug#38218 <38218@debbugs.gnu.org> Subject: Status: network-interface-list only returns IPv4 addresses Reply-To: bug#38218 <38218@debbugs.gnu.org> Date: Mon, 23 Jun 2025 23:46:14 +0000 retitle 38218 network-interface-list only returns IPv4 addresses reassign 38218 emacs submitter 38218 Robert Pluim severity 38218 normal tag 38218 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 15 05:13:10 2019 Received: (at submit) by debbugs.gnu.org; 15 Nov 2019 10:13:11 +0000 Received: from localhost ([127.0.0.1]:35688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVYbG-0002Ww-IU for submit@debbugs.gnu.org; Fri, 15 Nov 2019 05:13:10 -0500 Received: from lists.gnu.org ([209.51.188.17]:40215) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVYbF-0002Wp-BX for submit@debbugs.gnu.org; Fri, 15 Nov 2019 05:13:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55444) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVYbE-0000zu-El for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2019 05:13:09 -0500 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,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iVYbD-0002qv-HP for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2019 05:13:08 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:39923) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iVYbD-0002qG-Bb for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2019 05:13:07 -0500 Received: by mail-wm1-x32c.google.com with SMTP id t26so9738606wmi.4 for ; Fri, 15 Nov 2019 02:13:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:gmane-reply-to-list:date:message-id:mime-version; bh=QElQ8q0iQ44jZUcspCP21YQM5KTOC/Hj+CXQu4HALoA=; b=Oa6MEN7RCmxxiHZ/pzTGzZ/iT2DCJLrWj89V2xPwAkr/RbA4tG0k7STNCqMa966Xk0 10q7PzG5PK4Cqwlw7OJOw4B95QAXNjkgpvb3+Z3Xam4wo5wZ3fu595D2Dm5C1CNJkZ2u Anrp44oVnaiBPn4NRt8RoJatH183SVrfU3H1qwHBZvsUQN/1WTiJSmDvb/WCURa1c1Yz NX3CflJVb2y11t4nt4LdPhTOLwUGOibh1uVSwjSpF5HR7UR2eK9VAJwu7R+knflpUUKN HKiZ3EUTD8RP/EHp3dJ27i3VVKNT/hkujuhnwyMhZW5vicKc9QCB/oBG9zYEuH2UYwZ/ 8Qfw== 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:gmane-reply-to-list:date :message-id:mime-version; bh=QElQ8q0iQ44jZUcspCP21YQM5KTOC/Hj+CXQu4HALoA=; b=nELpzGh8DpkGVrQkXY1Py/fy8bqSR3KoscbUhdXB3oJKHUTs6aGM68FQGtk7JTNQo4 2+CRyp1G9+ToJetlTrxmFbUQlSvmdf7TT+MHz5wK/P4Kz/D/M4d7/eIbwaHcauhj80cC 2+I/cTo8kaxw5i9QtzS7VpfU5jAJb3CsEW1OH1TATvVQMgpl9uiJDQ/XnOMrkl/0uttM msGq0SuPYY7jmIHMNKo+5H4SDwBUFxgn6RjUIejxqTXkL24LBc3YGDxla3aSkLIT7Pek IXSLhGILFunX1w+1FMj9NtuCgQIYBvlO9Pn7sHt+HXtDUeHw/1goSgc8Q2gvAWOJZL0P 2x0w== X-Gm-Message-State: APjAAAVwijtRviAk8ygXEPE995l7mnyZqO7fI3YMokZb7vDp78bMvZmS 0ON2an3JXAvpKfdAclZawrWqFcQw X-Google-Smtp-Source: APXvYqzD5sFKcTvLo84L/7T0gJFKqY8IDmve6IEEWUSaD/LY38/wgJUtyQEpFokAufLN9aG8KX/XWA== X-Received: by 2002:a7b:c098:: with SMTP id r24mr13957428wmh.63.1573812784869; Fri, 15 Nov 2019 02:13:04 -0800 (PST) Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id z14sm10540459wrl.60.2019.11.15.02.13.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 02:13:04 -0800 (PST) From: Robert Pluim To: bug-gnu-emacs@gnu.org Subject: network-interface-list only returns IPv4 addresses X-Debbugs-No-Ack: yes Gmane-Reply-To-List: yes Date: Fri, 15 Nov 2019 11:13:03 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32c X-Spam-Score: 0.7 (/) 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: -2.3 (--) The current (2019-11-15) implementation of network-interface-list only supports returning IPv4 addresses, it should return IPv6 addresses as well (where possible). From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 15 05:18:54 2019 Received: (at 38218) by debbugs.gnu.org; 15 Nov 2019 10:18:54 +0000 Received: from localhost ([127.0.0.1]:35692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVYgm-0004bm-BM for submit@debbugs.gnu.org; Fri, 15 Nov 2019 05:18:53 -0500 Received: from mail-wr1-f49.google.com ([209.85.221.49]:39403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVYgj-0004bW-QR for 38218@debbugs.gnu.org; Fri, 15 Nov 2019 05:18:50 -0500 Received: by mail-wr1-f49.google.com with SMTP id l7so10341901wrp.6 for <38218@debbugs.gnu.org>; Fri, 15 Nov 2019 02:18:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:mime-version; bh=13KAeebxKojb369VHevGbOZtr9dgdtgkla1L8+M46/I=; b=XyBgVX1n9vd61PYVZjG1kzkRw2Gh4chcJUq+T3VPB5qf3Tvalw1Mpbf7ZnhG2i/3ND r/Dg1GYgZq7fUEsQO7Ej3BnqGcFQHDWsIqqRBM0WDL/JxQszbA36F9BlfkvjIwCYnF2N /+AgQ2socmIcsqEmsmL1HawPMV+IpbYXH7ksUcCC5DGssjZxxeodj5p/ledbOGQZgQr8 ni0ZtIZ+oRVg7BJ+1p4J+KWyg/NK42rUe01coovENgnpdg4uRJaKudECfn8yX59Kkz3J gBSYpbZPrGVxRAi4q+9J09LtN0WeFtAFpa3fBDxQ5lrjfKSUhKc4iEQYrHCKo/N6nZEI WEUQ== 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:references:gmane-reply-to-list :date:in-reply-to:message-id:mime-version; bh=13KAeebxKojb369VHevGbOZtr9dgdtgkla1L8+M46/I=; b=F8E9jsU6aotgkvZR7jQSAmIy3sHyq3hpbjHoqIKN7yVw1Z5e3lU5poEu5pBvlj+c+H /OCEVxe51KmHUUqkkTn2bmCss76AVKuWddTzHyX7mGvbTnwTowudrQX/cPXiu7nCAGnU yhf3r+XtLjZZxnN0C2ZHJVHIhKfouUtPUKT2NSKWlfqV26VsnCrqV3f2sP52Ev7iYYrm PAHWOkgoxdX66k8akSYCeCtP0fnrQhAhWI278EWmLbqFycGFvo9oRIPWtl99CbIkcSL9 AKxX7gbcC39xoCXMStdXvcs1W18tPKT0hbBbdqKfdixyx2oryfxnDZzBudPF9kUXcj1d 0ecw== X-Gm-Message-State: APjAAAUOOgwKah5fZQfMIUDrPRR8I5HyNUZDqO5z7f66ZRtqL1ry1gEb Ac9lAePcO3/qUDWoUT0Y4HPWdI9M X-Google-Smtp-Source: APXvYqxSwPTswg6U1ZLDIjVSgUl2P6mRuw5JqeukHllNcP6eQn4HQMDfTjFwSJYZIY57QOTLVSEjNg== X-Received: by 2002:a5d:4684:: with SMTP id u4mr13644120wrq.352.1573813123399; Fri, 15 Nov 2019 02:18:43 -0800 (PST) Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id s9sm8869055wmj.22.2019.11.15.02.18.42 for <38218@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 02:18:42 -0800 (PST) From: Robert Pluim To: 38218@debbugs.gnu.org Subject: Re: bug#38218: network-interface-list only returns IPv4 addresses References: X-Debbugs-No-Ack: yes Gmane-Reply-To-List: yes Date: Fri, 15 Nov 2019 11:18:41 +0100 In-Reply-To: (Robert Pluim's message of "Fri, 15 Nov 2019 11:13:03 +0100") Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38218 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 (-) --=-=-= Content-Type: text/plain >>>>> On Fri, 15 Nov 2019 11:13:03 +0100, Robert Pluim said: Robert> The current (2019-11-15) implementation of network-interface-list only Robert> supports returning IPv4 addresses, it should return IPv6 addresses as Robert> well (where possible). The following has been tested on macOS 10.14, Fedora 30, and mingw64 running on Windows 10. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Extend-network-interface-list-to-return-IPv6-and-net.patch >From 5eb703f8ed12af8205bf8cd5ba99baa5137a5dfa Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Fri, 15 Nov 2019 11:11:30 +0100 Subject: [PATCH] Extend network-interface-list to return IPv6 and network info To: emacs-devel@gnu.org Bug#38218 * src/process.c (Fnetwork_interface_list): Extend argument list to allow requesting full network info and/or IPv4/IPv6 info. (network_interface_list) [HAVE_GETIFADDRS]: Use getifaddrs to retrieve interface IP addresses. * src/process.h: Update prototype of network_interface_list. * src/w32.c (g_b_init_get_adapters_addresses): New init flag. (globals_of_w32): Initialize it. (GetAdaptersAddresses_Proc): New function typedef. (get_adapters_addresses): New wrapper function. (init_winsock): Load htonl and ntohl. (sys_htonl, sys_ntohl): New wrapper functions. (network_interface_list): Implement in terms of get_adapters_addresses. * nt/inc/sys/socket.h: Add sys_htonl and sys_ntohl prototypes. * etc/NEWS: Announce IPv4/IPv6 changes in network-interface-list. * doc/lispref/processes.texi (Misc Network): Document updated arglist and return values for network-interface-list. --- doc/lispref/processes.texi | 29 ++++- etc/NEWS | 5 + nt/inc/sys/socket.h | 4 + src/process.c | 158 +++++++++++++++--------- src/process.h | 2 +- src/w32.c | 244 ++++++++++++++++++++++++++++++++++++- 6 files changed, 375 insertions(+), 67 deletions(-) diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index 5caf0a2426..63383efb70 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi @@ -2971,12 +2971,27 @@ Misc Network on network connections. Note that they are supported only on some systems. -@defun network-interface-list -This function returns a list describing the network interfaces -of the machine you are using. The value is an alist whose -elements have the form @code{(@var{name} . @var{address})}. -@var{address} has the same form as the @var{local-address} -and @var{remote-address} arguments to @code{make-network-process}. +@defun network-interface-list &optional full family +This function returns a list describing the network interfaces of the +machine you are using. The value is an alist whose elements have the +form @code{(@var{ifname} . @var{address})}. @var{ifname} is a string +naming the interface, @var{address} has the same form as the +@var{local-address} and @var{remote-address} arguments to +@code{make-network-process}, i.e. a vector of integers. By default +both IPv4 and IPv6 addresses are returned if possible. + +Optional argument @var{full} non-@code{nil} means to instead return a +list of one or more elements of the form @w{@code{(@var{ifname} +@var{addr} @var{bcast} @var{netmask})}}. @var{ifname} is a non-unique +string naming the interface. @var{addr}, @var{bcast}, and +@var{netmask} are vectors of integers detailing the IP address, +broadcast address, and network mask. + +Optional argument @var{family} specified as symbol @code{ipv4} or +@code{ipv6} restricts the returned information to IPv4 and IPv6 +addresses respectively, independently of the value of @var{full}. +Speficying @code{ipv6} when IPv6 support is not available will result +in an error being signaled. @end defun @defun network-interface-info ifname @@ -2996,6 +3011,8 @@ Misc Network @item flags The current flags of the interface. @end table + +Note that this function returns only IPv4 information. @end defun @defun format-network-address address &optional omit-port diff --git a/etc/NEWS b/etc/NEWS index 485d2b1fdf..d73db73c9e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -234,6 +234,11 @@ To get the old, less-secure behavior, you can set the ** New function 'network-lookup-address-info'. This does IPv4 and/or IPv6 address lookups on hostnames. ++++ +** 'network-interface-list' can now return IPv4 and IPv6 addresses. +IPv4 and IPv6 addresses are now returned by default if available, +optionally including netmask/broadcast address information. + --- ** Control of the threshold for using the 'distant-foreground' color. The threshold for color distance below which the 'distant-foreground' diff --git a/nt/inc/sys/socket.h b/nt/inc/sys/socket.h index 6d26ff907e..0f3943b453 100644 --- a/nt/inc/sys/socket.h +++ b/nt/inc/sys/socket.h @@ -92,6 +92,8 @@ #define bind sys_bind #define connect sys_connect #define htons sys_htons #define ntohs sys_ntohs +#define htonl sys_htonl +#define ntohl sys_ntohl #define inet_addr sys_inet_addr #define gethostname sys_gethostname #define gethostbyname sys_gethostbyname @@ -112,6 +114,8 @@ #define freeaddrinfo sys_freeaddrinfo int sys_connect (int s, const struct sockaddr *addr, int namelen); u_short sys_htons (u_short hostshort); u_short sys_ntohs (u_short netshort); +u_long sys_htonl (u_long hostlong); +u_long sys_ntohl (u_long netlong); unsigned long sys_inet_addr (const char * cp); int sys_gethostname (char * name, int namelen); struct hostent * sys_gethostbyname (const char * name); diff --git a/src/process.c b/src/process.c index 9158cfd347..0f82682ae5 100644 --- a/src/process.c +++ b/src/process.c @@ -4255,73 +4255,86 @@ DEFUN ("make-network-process", Fmake_network_process, Smake_network_process, } -#ifdef HAVE_NET_IF_H -#ifdef SIOCGIFCONF +#ifdef HAVE_GETIFADDRS static Lisp_Object -network_interface_list (void) +network_interface_list (bool full, unsigned short match) { - struct ifconf ifconf; - struct ifreq *ifreq; - void *buf = NULL; - ptrdiff_t buf_size = 512; - int s; - Lisp_Object res; - ptrdiff_t count; + Lisp_Object res = Qnil; + struct ifaddrs *ifap; - s = socket (AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0); - if (s < 0) + if (getifaddrs (&ifap) == -1) return Qnil; - count = SPECPDL_INDEX (); - record_unwind_protect_int (close_file_unwind, s); - do + for (struct ifaddrs *it = ifap; it != NULL; it = it->ifa_next) { - buf = xpalloc (buf, &buf_size, 1, INT_MAX, 1); - ifconf.ifc_buf = buf; - ifconf.ifc_len = buf_size; - if (ioctl (s, SIOCGIFCONF, &ifconf)) - { - emacs_close (s); - xfree (buf); - return Qnil; - } - } - while (ifconf.ifc_len == buf_size); - - res = unbind_to (count, Qnil); - ifreq = ifconf.ifc_req; - while ((char *) ifreq < (char *) ifconf.ifc_req + ifconf.ifc_len) - { - struct ifreq *ifq = ifreq; -#ifdef HAVE_STRUCT_IFREQ_IFR_ADDR_SA_LEN -#define SIZEOF_IFREQ(sif) \ - ((sif)->ifr_addr.sa_len < sizeof (struct sockaddr) \ - ? sizeof (*(sif)) : sizeof ((sif)->ifr_name) + (sif)->ifr_addr.sa_len) + int len; + int addr_len; + uint32_t *maskp; + uint32_t *addrp; + Lisp_Object elt = Qnil; - int len = SIZEOF_IFREQ (ifq); -#else - int len = sizeof (*ifreq); + /* BSD can allegedly return interfaces with a NULL address. */ + if (it->ifa_addr == NULL) + continue; + if (match && it->ifa_addr->sa_family != match) + continue; + if (it->ifa_addr->sa_family == AF_INET) + { + DECLARE_POINTER_ALIAS (sin1, struct sockaddr_in, it->ifa_netmask); + maskp = (uint32_t *)&sin1->sin_addr; + DECLARE_POINTER_ALIAS (sin2, struct sockaddr_in, it->ifa_addr); + addrp = (uint32_t *)&sin2->sin_addr; + len = sizeof (struct sockaddr_in); + addr_len = 1; + } +#ifdef AF_INET6 + else if (it->ifa_addr->sa_family == AF_INET6) + { + DECLARE_POINTER_ALIAS (sin6_1, struct sockaddr_in6, it->ifa_netmask); + maskp = (uint32_t *) &sin6_1->sin6_addr; + DECLARE_POINTER_ALIAS (sin6_2, struct sockaddr_in6, it->ifa_addr); + addrp = (uint32_t *) &sin6_2->sin6_addr; + len = sizeof (struct sockaddr_in6); + addr_len = 4; + } #endif - char namebuf[sizeof (ifq->ifr_name) + 1]; - ifreq = (struct ifreq *) ((char *) ifreq + len); + else + continue; - if (ifq->ifr_addr.sa_family != AF_INET) - continue; + Lisp_Object addr = conv_sockaddr_to_lisp (it->ifa_addr, len); - memcpy (namebuf, ifq->ifr_name, sizeof (ifq->ifr_name)); - namebuf[sizeof (ifq->ifr_name)] = 0; - res = Fcons (Fcons (build_string (namebuf), - conv_sockaddr_to_lisp (&ifq->ifr_addr, - sizeof (struct sockaddr))), - res); + if (full) + { + elt = Fcons (conv_sockaddr_to_lisp (it->ifa_netmask, len), elt); + /* There is an it->ifa_broadaddr field, but its contents are + unreliable, so always calculate the broadcast address from + the address and the netmask. */ + int i; + uint32_t mask; + for (i = 0; i < addr_len; i++) + { + mask = maskp[i]; + maskp[i] = (addrp[i] & mask) | ~mask; + } + elt = Fcons (conv_sockaddr_to_lisp (it->ifa_netmask, len), elt); + elt = Fcons (addr, elt); + } + else + { + elt = addr; + } + res = Fcons (Fcons (build_string (it->ifa_name), elt), res); } +#ifdef HAVE_FREEIFADDRS + freeifaddrs (ifap); +#endif - xfree (buf); return res; } -#endif /* SIOCGIFCONF */ +#endif /* HAVE_GETIFADDRS */ +#ifdef HAVE_NET_IF_H #if defined (SIOCGIFADDR) || defined (SIOCGIFHWADDR) || defined (SIOCGIFFLAGS) struct ifflag_def { @@ -4550,17 +4563,46 @@ network_interface_info (Lisp_Object ifname) #endif /* defined (HAVE_NET_IF_H) */ DEFUN ("network-interface-list", Fnetwork_interface_list, - Snetwork_interface_list, 0, 0, 0, + Snetwork_interface_list, 0, 2, 0, doc: /* Return an alist of all network interfaces and their network address. -Each element is a cons, the car of which is a string containing the -interface name, and the cdr is the network address in internal -format; see the description of ADDRESS in `make-network-process'. +Each element is cons of the form (IFNAME . IP) where IFNAME is a +string containing the interface name, and IP is the network address in +internal format; see the description of ADDRESS in +`make-network-process'. The interface name is not guaranteed to be +unique. + +Optional parameter FULL non-nil means return all IP address info for +each interface. Each element is then a list of the form + (IFNAME IP BCAST MASK) +where IFNAME is the interface name, IP the IP address, +BCAST the broadcast address, and MASK the network mask. + +Optional parameter FAMILY controls the type of addresses to return. +The default of nil means both IPv4 and IPv6, symbol `ipv4' means IPv4 +only, symbol `ipv6' means IPv6 only. + +See also `network-interface-info', which is limited to IPv4 only. If the information is not available, return nil. */) - (void) + (Lisp_Object full, Lisp_Object family) { -#if (defined HAVE_NET_IF_H && defined SIOCGIFCONF) || defined WINDOWSNT - return network_interface_list (); +#if defined HAVE_GETIFADDRS || defined WINDOWSNT + unsigned short match; + bool full_info = false; + + if (! NILP (full)) + full_info = true; + if (NILP (family)) + match = 0; + else if (EQ (family, Qipv4)) + match = AF_INET; +#ifdef AF_INET6 + else if (EQ (family, Qipv6)) + match = AF_INET6; +#endif + else + error ("Unsupported address family"); + return network_interface_list (full_info, match); #else return Qnil; #endif diff --git a/src/process.h b/src/process.h index 5e957c4298..bf15317eb4 100644 --- a/src/process.h +++ b/src/process.h @@ -291,7 +291,7 @@ pset_gnutls_cred_type (struct Lisp_Process *p, Lisp_Object val) extern void restore_nofile_limit (void); #ifdef WINDOWSNT -extern Lisp_Object network_interface_list (void); +extern Lisp_Object network_interface_list (bool full, unsigned short match); extern Lisp_Object network_interface_info (Lisp_Object); #endif diff --git a/src/w32.c b/src/w32.c index 26ea15d891..76c226892a 100644 --- a/src/w32.c +++ b/src/w32.c @@ -227,6 +227,8 @@ #define FSCTL_GET_REPARSE_POINT \ #undef connect #undef htons #undef ntohs +#undef htonl +#undef ntohl #undef inet_addr #undef gethostname #undef gethostbyname @@ -326,6 +328,7 @@ #define FSCTL_GET_REPARSE_POINT \ static BOOL g_b_init_set_named_security_info_w; static BOOL g_b_init_set_named_security_info_a; static BOOL g_b_init_get_adapters_info; +static BOOL g_b_init_get_adapters_addresses; static BOOL g_b_init_reg_open_key_ex_w; static BOOL g_b_init_reg_query_value_ex_w; static BOOL g_b_init_expand_environment_strings_w; @@ -503,6 +506,12 @@ #define FSCTL_GET_REPARSE_POINT \ typedef DWORD (WINAPI *GetAdaptersInfo_Proc) ( PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen); +typedef DWORD (WINAPI *GetAdaptersAddresses_Proc) ( + ULONG, + ULONG, + PVOID, + PIP_ADAPTER_ADDRESSES, + PULONG); int (WINAPI *pMultiByteToWideChar)(UINT,DWORD,LPCSTR,int,LPWSTR,int); int (WINAPI *pWideCharToMultiByte)(UINT,DWORD,LPCWSTR,int,LPSTR,int,LPCSTR,LPBOOL); @@ -1368,6 +1377,31 @@ get_adapters_info (PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen) return s_pfn_Get_Adapters_Info (pAdapterInfo, pOutBufLen); } +static DWORD WINAPI +get_adapters_addresses (ULONG family, PIP_ADAPTER_ADDRESSES pAdapterAddresses, PULONG pOutBufLen) +{ + static GetAdaptersAddresses_Proc s_pfn_Get_Adapters_Addresses = NULL; + HMODULE hm_iphlpapi = NULL; + + if (is_windows_9x () == TRUE) + return ERROR_NOT_SUPPORTED; + + if (g_b_init_get_adapters_addresses == 0) + { + g_b_init_get_adapters_addresses = 1; + hm_iphlpapi = LoadLibrary ("Iphlpapi.dll"); + if (hm_iphlpapi) + s_pfn_Get_Adapters_Addresses = (GetAdaptersAddresses_Proc) + get_proc_addr (hm_iphlpapi, "GetAdaptersAddresses"); + } + if (s_pfn_Get_Adapters_Addresses == NULL) + return ERROR_NOT_SUPPORTED; + ULONG flags = GAA_FLAG_SKIP_ANYCAST + | GAA_FLAG_SKIP_MULTICAST + | GAA_FLAG_SKIP_DNS_SERVER; + return s_pfn_Get_Adapters_Addresses (family, flags, NULL, pAdapterAddresses, pOutBufLen); +} + static LONG WINAPI reg_open_key_ex_w (HKEY hkey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult) @@ -7414,6 +7448,8 @@ int (PASCAL *pfn_WSACleanup) (void); u_short (PASCAL *pfn_htons) (u_short hostshort); u_short (PASCAL *pfn_ntohs) (u_short netshort); +u_long (PASCAL *pfn_htonl) (u_long hostlong); +u_long (PASCAL *pfn_ntohl) (u_long netlong); unsigned long (PASCAL *pfn_inet_addr) (const char * cp); int (PASCAL *pfn_gethostname) (char * name, int namelen); struct hostent * (PASCAL *pfn_gethostbyname) (const char * name); @@ -7504,6 +7540,8 @@ #define LOAD_PROC(fn) \ LOAD_PROC (shutdown); LOAD_PROC (htons); LOAD_PROC (ntohs); + LOAD_PROC (htonl); + LOAD_PROC (ntohl); LOAD_PROC (inet_addr); LOAD_PROC (gethostname); LOAD_PROC (gethostbyname); @@ -7884,6 +7922,19 @@ sys_ntohs (u_short netshort) return (winsock_lib != NULL) ? pfn_ntohs (netshort) : netshort; } +u_long +sys_htonl (u_long hostlong) +{ + return (winsock_lib != NULL) ? + pfn_htonl (hostlong) : hostlong; +} + +u_long +sys_ntohl (u_long netlong) +{ + return (winsock_lib != NULL) ? + pfn_ntohl (netlong) : netlong; +} unsigned long sys_inet_addr (const char * cp) @@ -9382,9 +9433,197 @@ network_interface_get_info (Lisp_Object ifname) } Lisp_Object -network_interface_list (void) +network_interface_list (bool full, unsigned short match) { - return network_interface_get_info (Qnil); + ULONG ainfo_len = sizeof (IP_ADAPTER_ADDRESSES); + ULONG family = match; + IP_ADAPTER_ADDRESSES *adapter, *ainfo = xmalloc (ainfo_len); + DWORD retval = get_adapters_addresses (family, ainfo, &ainfo_len); + Lisp_Object res = Qnil; + + if (retval == ERROR_BUFFER_OVERFLOW) + { + ainfo = xrealloc (ainfo, ainfo_len); + retval = get_adapters_addresses (family, ainfo, &ainfo_len); + } + + if (retval != ERROR_SUCCESS) + { + xfree (ainfo); + return res; + } + + /* For the below, we need some winsock functions, so make sure + the winsock DLL is loaded. If we cannot successfully load + it, they will have no use of the information we provide, + anyway, so punt. */ + if (!winsock_lib && !init_winsock (1)) + return res; + + int eth_count = 0, tr_count = 0, fddi_count = 0, ppp_count = 0; + int sl_count = 0, wlan_count = 0, lo_count = 0, ifx_count = 0; + int tnl_count = 0; + int if_num; + char namebuf[MAX_ADAPTER_NAME_LENGTH + 4]; + static const char *ifmt[] = { + "eth%d", "tr%d", "fddi%d", "ppp%d", "sl%d", "wlan%d", + "lo%d", "ifx%d", "tunnel%d" + }; + enum { + NONE = -1, + ETHERNET = 0, + TOKENRING = 1, + FDDI = 2, + PPP = 3, + SLIP = 4, + WLAN = 5, + LOOPBACK = 6, + OTHER_IF = 7, + TUNNEL = 8 + } ifmt_idx; + + for (adapter = ainfo; adapter; adapter = adapter->Next) + { + + /* Present Unix-compatible interface names, instead of the + Windows names, which are really GUIDs not readable by + humans. */ + + switch (adapter->IfType) + { + case IF_TYPE_ETHERNET_CSMACD: + ifmt_idx = ETHERNET; + if_num = eth_count++; + break; + case IF_TYPE_ISO88025_TOKENRING: + ifmt_idx = TOKENRING; + if_num = tr_count++; + break; + case IF_TYPE_FDDI: + ifmt_idx = FDDI; + if_num = fddi_count++; + break; + case IF_TYPE_PPP: + ifmt_idx = PPP; + if_num = ppp_count++; + break; + case IF_TYPE_SLIP: + ifmt_idx = SLIP; + if_num = sl_count++; + break; + case IF_TYPE_IEEE80211: + ifmt_idx = WLAN; + if_num = wlan_count++; + break; + case IF_TYPE_SOFTWARE_LOOPBACK: + ifmt_idx = LOOPBACK; + if_num = lo_count++; + break; + case IF_TYPE_TUNNEL: + ifmt_idx = TUNNEL; + if_num = tnl_count++; + break; + default: + ifmt_idx = OTHER_IF; + if_num = ifx_count++; + break; + } + sprintf (namebuf, ifmt[ifmt_idx], if_num); + + IP_ADAPTER_UNICAST_ADDRESS *address; + for (address = adapter->FirstUnicastAddress; address; address = address->Next) + { + int len; + int addr_len; + uint32_t *maskp; + uint32_t *addrp; + Lisp_Object elt = Qnil; + struct sockaddr *ifa_addr = address->Address.lpSockaddr; + + if (ifa_addr == NULL) + continue; + if (match && ifa_addr->sa_family != match) + continue; + + struct sockaddr_in ipv4; +#ifdef AF_INET6 + struct sockaddr_in6 ipv6; +#endif + struct sockaddr *sin; + + if (ifa_addr->sa_family == AF_INET) + { + ipv4.sin_family = AF_INET; + ipv4.sin_port = 0; + DECLARE_POINTER_ALIAS (sin_in, struct sockaddr_in, ifa_addr); + addrp = (uint32_t *)&sin_in->sin_addr; + maskp = (uint32_t *)&ipv4.sin_addr; + sin = (struct sockaddr *)&ipv4; + len = sizeof (struct sockaddr_in); + addr_len = 1; + } +#ifdef AF_INET6 + else if (ifa_addr->sa_family == AF_INET6) + { + ipv6.sin6_family = AF_INET6; + ipv6.sin6_port = 0; + DECLARE_POINTER_ALIAS (sin_in6, struct sockaddr_in6, ifa_addr); + addrp = (uint32_t *)&sin_in6->sin6_addr; + maskp = (uint32_t *)&ipv6.sin6_addr; + sin = (struct sockaddr *)&ipv6; + len = sizeof (struct sockaddr_in6); + addr_len = 4; + } +#endif + else + continue; + + Lisp_Object addr = conv_sockaddr_to_lisp (ifa_addr, len); + + if (full) + { + /* GetAdaptersAddress returns information in network + byte order, so convert from host to network order + when generating the netmask. */ + int i; + ULONG numbits = address->OnLinkPrefixLength; + for (i = 0; i < addr_len; i++) + { + if (numbits >= 32) + { + maskp[i] = -1U; + numbits -= 32; + } + else if (numbits) + { + maskp[i] = sys_htonl (-1U << (32 - numbits)); + numbits = 0; + } + else + { + maskp[i] = 0; + } + } + elt = Fcons (conv_sockaddr_to_lisp (sin, len), elt); + uint32_t mask; + for (i = 0; i < addr_len; i++) + { + mask = maskp[i]; + maskp[i] = (addrp[i] & mask) | ~mask; + + } + elt = Fcons (conv_sockaddr_to_lisp (sin, len), elt); + elt = Fcons (addr, elt); + } + else + { + elt = addr; + } + res = Fcons (Fcons (build_string (namebuf), elt), res); + } + } + xfree (ainfo); + return res; } Lisp_Object @@ -10099,6 +10338,7 @@ globals_of_w32 (void) g_b_init_set_named_security_info_w = 0; g_b_init_set_named_security_info_a = 0; g_b_init_get_adapters_info = 0; + g_b_init_get_adapters_addresses = 0; g_b_init_reg_open_key_ex_w = 0; g_b_init_reg_query_value_ex_w = 0; g_b_init_expand_environment_strings_w = 0; -- 2.23.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 16 00:17:21 2019 Received: (at 38218) by debbugs.gnu.org; 16 Nov 2019 05:17:21 +0000 Received: from localhost ([127.0.0.1]:37618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVqSX-0008Iz-41 for submit@debbugs.gnu.org; Sat, 16 Nov 2019 00:17:21 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVqSU-0008FE-U7 for 38218@debbugs.gnu.org; Sat, 16 Nov 2019 00:17:19 -0500 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iVqSN-0006Dj-2L; Sat, 16 Nov 2019 06:17:13 +0100 From: Lars Ingebrigtsen To: Robert Pluim Subject: Re: bug#38218: network-interface-list only returns IPv4 addresses References: Date: Sat, 16 Nov 2019 06:17:10 +0100 In-Reply-To: (Robert Pluim's message of "Fri, 15 Nov 2019 11:18:41 +0100") Message-ID: <8736eoiend.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Robert Pluim writes: > +Optional argument @var{full} non-@code{nil} means to instead return a > +list of one or more elements of the form @w{@code{(@var{ifname} > +@var{addr} @var{bcast} @var{netmask})}}. @var{ifname} is [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: ingebrigtsen.no] -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38218 Cc: 38218@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 (-) Robert Pluim writes: > +Optional argument @var{full} non-@code{nil} means to instead return a > +list of one or more elements of the form @w{@code{(@var{ifname} > +@var{addr} @var{bcast} @var{netmask})}}. @var{ifname} is a non-unique > +string naming the interface. @var{addr}, @var{bcast}, and > +@var{netmask} are vectors of integers detailing the IP address, > +broadcast address, and network mask. I think it might make sense to include an example output from the function here to make it clearer what the string bit is, in particular. I've otherwise just skimmed the patch (and not tried it), but it makes sense to me. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 17 15:50:13 2019 Received: (at 38218) by debbugs.gnu.org; 17 Nov 2019 20:50:13 +0000 Received: from localhost ([127.0.0.1]:42761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iWRUo-0007sp-Tr for submit@debbugs.gnu.org; Sun, 17 Nov 2019 15:50:12 -0500 Received: from mail-wr1-f41.google.com ([209.85.221.41]:38886) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iWRUm-0007sZ-8w for 38218@debbugs.gnu.org; Sun, 17 Nov 2019 15:50:08 -0500 Received: by mail-wr1-f41.google.com with SMTP id i12so17091028wro.5 for <38218@debbugs.gnu.org>; Sun, 17 Nov 2019 12:50:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=daMehE3pfro9iuvIC00lpMvZrwVvZo8xTmEl5FvKFE0=; b=i8Ajw7BZYDG/OXs+7X+cSbtZFG0kNBXA739ASW+DljuqHRcDA82uee9UxtdZtees5Q OKGNt6en4pvcP5fqN87JcrSoRi6t7jneJX3ikZt6kFqNq5+krt6kPvuWdWd4LMmXXh7q 2uSVNhehtpO6LIpYWnZVi5ZU6f2q3UBM++yCtUIVv6N785WAM7ZMXnRIPB2yN1N7zz2t QWPKafsxb/zXUlXXTtqHjDwSkb7ia1m9AVdMJc1Pun9b//iQfXoNj7b639ba1L/k2bvO wQTCYdreu6C6gIA0eFuG5zi8FTvCR8Slx6ZJ3+PCXLigZT4F11NuMWmEsspi2vbYxlAL APzw== 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 :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=daMehE3pfro9iuvIC00lpMvZrwVvZo8xTmEl5FvKFE0=; b=InAXkENKfgurMpyrKrw+teHktDhiVxxvSIOUfLfXLzdwO78oK807OxiFSjDGgRyefR B9xYHhgCpBYv3fxLGvvvxoBvVG0j1XmaaTi/EmQDL0SOR6c2zslhjNGSABWPnEiMbzz2 eU7nqYaOUpwkl7qLjTnERI3+kPvkgvvr++5sS56V5B7v1VZIJFghVZzlMu/Pyi46ZEFL 02vK7+ImX1XKE7PG+IBS+3oLNdDDle2mGmKhgx/b1GD9oGYoBtFnkWH/tuK7w4PkREhw eqSTpGE+wrB2iBDInMhu1S44fVVYGWj64aPuI+0wVa9/8po+atFaBeTA+RkiSipkXAvx 0vqw== X-Gm-Message-State: APjAAAWV6decgRPBSoGjxeyfOMDW96P5o4d+2JvKSJqXOVGlQQdvauqZ g9dcPkONsa69mpUODdIrY7deXvmc X-Google-Smtp-Source: APXvYqynMYSwJ2WKKGqNU1qwm9VtJNnXfpKFhZmhWIUlnNHnoYJwqQ6PwusosI8uHVGU1hlKykvWFg== X-Received: by 2002:adf:fd45:: with SMTP id h5mr29160492wrs.388.1574023801936; Sun, 17 Nov 2019 12:50:01 -0800 (PST) Received: from rpluim-mac ([2a01:e34:ecfc:a860:e5ed:2be6:eb41:ad68]) by smtp.gmail.com with ESMTPSA id u18sm20726871wrp.14.2019.11.17.12.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Nov 2019 12:50:01 -0800 (PST) From: Robert Pluim To: Lars Ingebrigtsen Subject: Re: bug#38218: network-interface-list only returns IPv4 addresses References: <8736eoiend.fsf@gnus.org> X-Debbugs-No-Ack: yes Gmane-Reply-To-List: yes Date: Sun, 17 Nov 2019 21:50:00 +0100 In-Reply-To: <8736eoiend.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 16 Nov 2019 06:17:10 +0100") 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: 38218 Cc: 38218@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 Sat, 16 Nov 2019 06:17:10 +0100, Lars Ingebrigtsen said: Lars> Robert Pluim writes: >> +Optional argument @var{full} non-@code{nil} means to instead return= a >> +list of one or more elements of the form @w{@code{(@var{ifname} >> +@var{addr} @var{bcast} @var{netmask})}}. @var{ifname} is a non-uni= que >> +string naming the interface. @var{addr}, @var{bcast}, and >> +@var{netmask} are vectors of integers detailing the IP address, >> +broadcast address, and network mask. Lars> I think it might make sense to include an example output from the Lars> function here to make it clearer what the string bit is, in parti= cular. Sure. Lars> I've otherwise just skimmed the patch (and not tried it), but it = makes Lars> sense to me. I=CA=BCll just push and wait for the screams then. (Eli, that=CA=BCs a joke= ). Robert From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 26 03:38:04 2019 Received: (at 38218) by debbugs.gnu.org; 26 Nov 2019 08:38:04 +0000 Received: from localhost ([127.0.0.1]:50176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZWMF-0003Cs-T2 for submit@debbugs.gnu.org; Tue, 26 Nov 2019 03:38:04 -0500 Received: from mail-wr1-f54.google.com ([209.85.221.54]:43865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZWMD-0003CG-Ov; Tue, 26 Nov 2019 03:38:02 -0500 Received: by mail-wr1-f54.google.com with SMTP id n1so21355687wra.10; Tue, 26 Nov 2019 00:38:01 -0800 (PST) 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=XKDLHyJB/FzxSdgCL28vgqxDxajgNDAefxF6GlMgGOg=; b=lXiZvIeFpJjGFt0XNdAr86QD9LhvpqZKfc8tha1FkG4wKEk45hluH5Exs5veSWzHMw pqGuCiwEq36BLr5B9XcrMeo60rA4yUtytrjo4uEytlFU+BbQ8CTQEHy8Rpa6ZtSi6I4z 0nMbf0qNtwZYvbc+xosGsziG+ulpARlJXyJLwa9wvLfWumTfbKNtKZr0BSmDsCscf1YR 8Lv5RUCKFSM8dO5841wG/YlfbbL/rKvGDWEhSDbTSTeuN2dOWeQUIY9VkltoF2IpdNNo 0mapw7RvQq3Pn3DKd9zePopVnVjyZ9Cb6RmKDqclH/l5R/uAO/+9prvtd9Y+Hxhy7FUp ezKA== 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=XKDLHyJB/FzxSdgCL28vgqxDxajgNDAefxF6GlMgGOg=; b=RVDPpCpAULOFLL3Fe3UzL6tMuLSKAZDH5y1priubb0AGrYzElUzwnmGJ6ua2ehFVNx kuvQCHI2uwIITkWMU0ozYu0P4/dCJRcuv7fMuLajAcRGsHSfhM1gpDVq7kL1MEwU3ViD sYuI37AGI5986kazv9Dl7TLD+iFXTb18lrNFXi536bMi/pIh6fV5yqUi/j1/nixvDc5l vv1fm9o1ks+JhBch5daEJlC3rb7YtBYFcBOBD2A8sCoXLhHAAYgkxD6RnD+68t9KXUT4 1ZzN3+stzzwkVPqaB1PKfBiM1/0ql7jTWWlKrw9A8TZMAOhZ4M3e2JpRCfsmf5XJVjFQ 7hqg== X-Gm-Message-State: APjAAAWLPFVd9Ko6Q0VNpmRIuCoTrfvN3KE3h8wF4q7cMz7FqTfKkYuf dfktpQ+ad3ilG2JENutBZi2rAEi93w0= X-Google-Smtp-Source: APXvYqydvkJUFd7jugOSUS6mSHbXtfHP0D60aL0bhTQVk6F0t01A6EX4WfDxl6+G/uUmR5EQpeVpkA== X-Received: by 2002:adf:e78b:: with SMTP id n11mr19397974wrm.10.1574757475261; Tue, 26 Nov 2019 00:37:55 -0800 (PST) Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id w10sm2153732wmd.26.2019.11.26.00.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 00:37:54 -0800 (PST) From: Robert Pluim To: Lars Ingebrigtsen Subject: Re: bug#38218: network-interface-list only returns IPv4 addresses References: <8736eoiend.fsf@gnus.org> Date: Tue, 26 Nov 2019 09:37:53 +0100 In-Reply-To: (Robert Pluim's message of "Sun, 17 Nov 2019 21:50:00 +0100") 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: 38218 Cc: 38218@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 (-) tags 38218 fixed close 38218 27.1 quit >>>>> On Sun, 17 Nov 2019 21:50:00 +0100, Robert Pluim s= aid: >>>>> On Sat, 16 Nov 2019 06:17:10 +0100, Lars Ingebrigtsen said: Lars> I've otherwise just skimmed the patch (and not tried it), but it = makes Lars> sense to me. Robert> I=CA=BCll just push and wait for the screams then. (Eli, that= =CA=BCs a joke). I=CA=BCve now pushed it. Closing. Committed as 650a514e99 From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 26 12:17:50 2019 Received: (at 38218) by debbugs.gnu.org; 26 Nov 2019 17:17:50 +0000 Received: from localhost ([127.0.0.1]:52866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZeTG-0005VB-9m for submit@debbugs.gnu.org; Tue, 26 Nov 2019 12:17:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZeTF-0005Uz-MU for 38218@debbugs.gnu.org; Tue, 26 Nov 2019 12:17:50 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iZeTA-0008FU-83; Tue, 26 Nov 2019 12:17:44 -0500 Received: from [176.228.60.248] (port=2630 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iZeT9-0000Yc-JV; Tue, 26 Nov 2019 12:17:44 -0500 Date: Tue, 26 Nov 2019 19:17:49 +0200 Message-Id: <83h82qsgjm.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-reply-to: (message from Robert Pluim on Tue, 26 Nov 2019 09:37:53 +0100) Subject: Re: bug#38218: network-interface-list only returns IPv4 addresses References: <8736eoiend.fsf@gnus.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38218 Cc: 38218@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: -3.3 (---) > From: Robert Pluim > Date: Tue, 26 Nov 2019 09:37:53 +0100 > Cc: 38218@debbugs.gnu.org > > Robert> Iʼll just push and wait for the screams then. (Eli, thatʼs a joke). > > Iʼve now pushed it. It needed a bit of tweaking for mingw.org's MinGW, so that it would work on XP. However, after making the changes, one test from nsm-tests.el fails here: 127.1/0 No such host is known. 127.1/0 No such host is known. Test nsm-check-local-subnet-ipv4 backtrace: signal(ert-test-failed (((should (eq nil (nsm-should-check "127.1") ert-fail(((should (eq nil (nsm-should-check "127.1"))) :form (eq ni (if (unwind-protect (setq value-44 (apply fn-42 args-43)) (setq for (let (form-description-46) (if (unwind-protect (setq value-44 (appl (let ((value-44 'ert-form-evaluation-aborted-45)) (let (form-descri (let* ((fn-42 #'eq) (args-43 (condition-case err (let ((signal-hook (let ((nsm-trust-local-network t)) (let* ((fn-37 #'eq) (args-38 (co (let ((local-ip '[172 26 128 160 0]) (mask '[255 255 255 0 0]) (wro (closure (t) nil (let ((local-ip '[172 26 128 160 0]) (mask '[255 2 ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-tes ert-run-test(#s(ert-test :name nsm-check-local-subnet-ipv4 :documen ert-run-or-rerun-test(#s(ert--stats :selector (not (tag :unstable)) ert-run-tests((not (tag :unstable)) #f(compiled-function (event-typ ert-run-tests-batch((not (tag :unstable))) ert-run-tests-batch-and-exit((not (tag :unstable))) eval((ert-run-tests-batch-and-exit '(not (tag :unstable))) t) command-line-1((#("-L" 0 2 (charset cp862)) #(";." 0 2 (charset cp8 command-line() normal-top-level() Test nsm-check-local-subnet-ipv4 condition: (ert-test-failed ((should (eq nil (nsm-should-check "127.1"))) :form (eq nil t) :value nil)) FAILED 1/2 nsm-check-local-subnet-ipv4 (4.656250 sec) Does it work for you in your MinGW build? If so, could you eyeball the code I added/modified in w32.c to see if I goofed somewhere? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 26 13:10:16 2019 Received: (at 38218) by debbugs.gnu.org; 26 Nov 2019 18:10:16 +0000 Received: from localhost ([127.0.0.1]:52890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZfI0-0006iF-8w for submit@debbugs.gnu.org; Tue, 26 Nov 2019 13:10:16 -0500 Received: from mail-wm1-f46.google.com ([209.85.128.46]:50500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZfHx-0006hz-SS for 38218@debbugs.gnu.org; Tue, 26 Nov 2019 13:10:14 -0500 Received: by mail-wm1-f46.google.com with SMTP id l17so4280225wmh.0 for <38218@debbugs.gnu.org>; Tue, 26 Nov 2019 10:10:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:mime-version; bh=Qy2KL8WSTQTKw6UBsaGhypKfmv1uGJzsUQUG3xBKGS4=; b=cgUmxQ2olzaWFtp1H1Xp7pGmDKJUhBxheK7ybveSWlXKTaPkhzfqV3csCvKQv9qjCL /sMS/MX6XFei1yhqNFdQBR4OyP7I2bi2c/Pk5OTdCx6w0K5SnDCUzQdLu6tEzntJoJcf p9kZPBGTD4DkPEPMoNfA4zyzSUESdSzgIn9QcXpmf73fL3SAJPO7FHHnfriKxQvWTDVf Blko2dCjyLoCanS7w2D6PRHkD+trladoLFzbyHtgm58bgJuF0+pCOrJlC4dLNSU2SvU3 ++Huj+iIk0Ty4xpdFPn+Y1EQnnH8NNC2Ltk+4MKx/CAjxnH4AOpEYlubBxA1ucboTWP+ RP1g== 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 :gmane-reply-to-list:date:in-reply-to:message-id:mime-version; bh=Qy2KL8WSTQTKw6UBsaGhypKfmv1uGJzsUQUG3xBKGS4=; b=EarKo9/+cfXL8mrZB1wn6tD1HroOkSbdqaDt50bRfcQcwU6o1J0zvhXDcNTmTgkpsq ffn1YjYrjSTD28lgwaZJEQ5UNhFVoPA8Dfbx08kxTDed+1gSOdFCw7u4K5C+g++E/Cb3 MKhIKDCfM3H78H0S4lmyblRj3YMaN1ESjiyAZXkfKiuVC4dGAzQnwvWSmP4uHbxPBSer GfkTEubBeYKEvagAihpZVkq3FzzaT7UVRTJED3fLIf64LVgJea0KCSJUUoQUoq9GrFYm 5XpNT1EG7OVFMV52h2sXp4BsGVC/0JcRgEYxI7YAMTogL1qfz+LnNL2dXFUQBBUDvVXm 0FWw== X-Gm-Message-State: APjAAAU+iAEyqsSBb6w4iBsVFG+tfgKXWTnrr+XtDF9MHbtD0qiuNCLd /tqZD595GmN1EGujkdQmTr5gvuQS X-Google-Smtp-Source: APXvYqy6Qe8l0Q1rzC4kCKQ3Da3i5rTkT/YQJvLzSH/bM0MhvBWWxEBhZ+zxPkSEyCNE9MlcNcstoA== X-Received: by 2002:a7b:ce12:: with SMTP id m18mr371966wmc.130.1574791807497; Tue, 26 Nov 2019 10:10:07 -0800 (PST) Received: from rpluim-mac ([2a01:e34:ecfc:a860:e411:a3bc:3f6:bb15]) by smtp.gmail.com with ESMTPSA id s8sm15733808wrt.57.2019.11.26.10.10.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 10:10:06 -0800 (PST) From: Robert Pluim To: Eli Zaretskii Subject: Re: bug#38218: network-interface-list only returns IPv4 addresses References: <8736eoiend.fsf@gnus.org> <83h82qsgjm.fsf@gnu.org> X-Debbugs-No-Ack: yes Gmane-Reply-To-List: yes Date: Tue, 26 Nov 2019 19:10:04 +0100 In-Reply-To: <83h82qsgjm.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 26 Nov 2019 19:17:49 +0200") Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38218 Cc: 38218@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 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>>>> On Tue, 26 Nov 2019 19:17:49 +0200, Eli Zaretskii said: Eli> It needed a bit of tweaking for mingw.org's MinGW, so that it would Eli> work on XP. However, after making the changes, one test from Eli> nsm-tests.el fails here: Thanks for that Eli> 127.1/0 No such host is known. Eli> 127.1/0 No such host is known. Eli> Test nsm-check-local-subnet-ipv4 backtrace: Eli> signal(ert-test-failed (((should (eq nil (nsm-should-check "12= 7.1") Eli> ert-fail(((should (eq nil (nsm-should-check "127.1"))) :form (= eq ni Eli> (if (unwind-protect (setq value-44 (apply fn-42 args-43)) (set= q for Eli> (let (form-description-46) (if (unwind-protect (setq value-44 = (appl Eli> (let ((value-44 'ert-form-evaluation-aborted-45)) (let (form-d= escri Eli> (let* ((fn-42 #'eq) (args-43 (condition-case err (let ((signal= -hook Eli> (let ((nsm-trust-local-network t)) (let* ((fn-37 #'eq) (args-3= 8 (co Eli> (let ((local-ip '[172 26 128 160 0]) (mask '[255 255 255 0 0])= (wro Eli> (closure (t) nil (let ((local-ip '[172 26 128 160 0]) (mask '[= 255 2 Eli> ert--run-test-internal(#s(ert--test-execution-info :test #s(er= t-tes Eli> ert-run-test(#s(ert-test :name nsm-check-local-subnet-ipv4 :do= cumen Eli> ert-run-or-rerun-test(#s(ert--stats :selector (not (tag :unsta= ble)) Eli> ert-run-tests((not (tag :unstable)) #f(compiled-function (even= t-typ Eli> ert-run-tests-batch((not (tag :unstable))) Eli> ert-run-tests-batch-and-exit((not (tag :unstable))) Eli> eval((ert-run-tests-batch-and-exit '(not (tag :unstable))) t) Eli> command-line-1((#("-L" 0 2 (charset cp862)) #(";." 0 2 (charse= t cp8 Eli> command-line() Eli> normal-top-level() Eli> Test nsm-check-local-subnet-ipv4 condition: Eli> (ert-test-failed Eli> ((should Eli> (eq nil Eli> (nsm-should-check "127.1"))) Eli> :form Eli> (eq nil t) Eli> :value nil)) Eli> FAILED 1/2 nsm-check-local-subnet-ipv4 (4.656250 sec) Eek. mingw (or winsock) doesn=CA=BCt support getaddrinfo("127.1",...), although getaddrinfo("127.0.0.1",...) seems to work. This fixes it for me: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Use-127.0.0.1-in-nsm-tests.patch >From e441c874ac7e7a0c7724af85ebf2d1678aea3a88 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Tue, 26 Nov 2019 19:07:42 +0100 Subject: [PATCH] Use 127.0.0.1 in nsm-tests To: emacs-devel@gnu.org Winsock doesn't like "127.1" * test/lisp/net/nsm-tests.el (nsm-check-local-subnet-ipv4): Spell numeric localhost as "127.0.0.1" instead of "127.1". --- test/lisp/net/nsm-tests.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/lisp/net/nsm-tests.el b/test/lisp/net/nsm-tests.el index 8e52568d71..97edcca80d 100644 --- a/test/lisp/net/nsm-tests.el +++ b/test/lisp/net/nsm-tests.el @@ -42,11 +42,11 @@ nsm-check-local-subnet-ipv4 (should-error (nsm-network-same-subnet local-ip wrong-length-mask remote-ip-yes)) (should (eq nil (nsm-network-same-subnet local-ip wrong-mask remote-ip-yes))) (should (eq t (nsm-should-check "google.com"))) - (should (eq t (nsm-should-check "127.1"))) + (should (eq t (nsm-should-check "127.0.0.1"))) (should (eq t (nsm-should-check "localhost"))) (let ((nsm-trust-local-network t)) (should (eq t (nsm-should-check "google.com"))) - (should (eq nil (nsm-should-check "127.1"))) + (should (eq nil (nsm-should-check "127.0.0.1"))) (should (eq nil (nsm-should-check "localhost")))))) (defun nsm-ipv6-is-available () -- 2.24.0.155.gd9f6f3b619 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 26 13:23:33 2019 Received: (at 38218) by debbugs.gnu.org; 26 Nov 2019 18:23:33 +0000 Received: from localhost ([127.0.0.1]:52912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZfUr-00072y-EC for submit@debbugs.gnu.org; Tue, 26 Nov 2019 13:23:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44999) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZfUp-00072h-Hu for 38218@debbugs.gnu.org; Tue, 26 Nov 2019 13:23:31 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iZfUi-0007EA-Do; Tue, 26 Nov 2019 13:23:24 -0500 Received: from [176.228.60.248] (port=2701 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iZfUh-0006Js-TT; Tue, 26 Nov 2019 13:23:24 -0500 Date: Tue, 26 Nov 2019 20:23:30 +0200 Message-Id: <834kyqsdi5.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-reply-to: (message from Robert Pluim on Tue, 26 Nov 2019 19:10:04 +0100) Subject: Re: bug#38218: network-interface-list only returns IPv4 addresses References: <8736eoiend.fsf@gnus.org> <83h82qsgjm.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38218 Cc: 38218@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: -3.3 (---) > From: Robert Pluim > Cc: 38218@debbugs.gnu.org > Date: Tue, 26 Nov 2019 19:10:04 +0100 > > Eli> It needed a bit of tweaking for mingw.org's MinGW, so that it would > Eli> work on XP. However, after making the changes, one test from > Eli> nsm-tests.el fails here: > > Thanks for that Thanks for reviewing it. > Eli> Test nsm-check-local-subnet-ipv4 condition: > Eli> (ert-test-failed > Eli> ((should > Eli> (eq nil > Eli> (nsm-should-check "127.1"))) > Eli> :form > Eli> (eq nil t) > Eli> :value nil)) > Eli> FAILED 1/2 nsm-check-local-subnet-ipv4 (4.656250 sec) > > Eek. mingw (or winsock) doesnʼt support getaddrinfo("127.1",...), > although getaddrinfo("127.0.0.1",...) seems to work. This fixes it for me: For me as well, thanks. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 26 13:29:46 2019 Received: (at 38218) by debbugs.gnu.org; 26 Nov 2019 18:29:46 +0000 Received: from localhost ([127.0.0.1]:52923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZfas-0007CE-D0 for submit@debbugs.gnu.org; Tue, 26 Nov 2019 13:29:46 -0500 Received: from mail-wm1-f45.google.com ([209.85.128.45]:33790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZfaq-0007C1-Hi for 38218@debbugs.gnu.org; Tue, 26 Nov 2019 13:29:45 -0500 Received: by mail-wm1-f45.google.com with SMTP id t26so3042634wmi.0 for <38218@debbugs.gnu.org>; Tue, 26 Nov 2019 10:29:44 -0800 (PST) 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=OZfSTy4VW+D/PNQMGRuPH9TE8BH18tO4mWfAW/2QfYc=; b=jW9XtULqvsuoNuzKLKCutdTzHVQQMpVhkWRxlZgCtnO57Df9wQwOMt6A3ZaeNmZ9CJ ruEQG1vpkNdR7Ztebs1bg9ku7EUUQccjxuPArnxcPxplcqrSB31QWuNsRaBsowHMTk71 g4COKnOlebblhhVt5HRvX3rbARULREqjnJ6T2BGDTRerI5oCvacnsIzCBmf3pL1LB8VC e5JbUj3v83I+Ac8RSceWaJ4wOKFCL2qE0NKHJdYwGe83CNal1B7Ds7BjriFKBbklVNq4 4kLkLKcwfaaSJs2njYfhE+MPDeK/vjpDhUdnCPBsjKDXOpE3Agv+gIBAm4RYskxt9rGq kTwQ== 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=OZfSTy4VW+D/PNQMGRuPH9TE8BH18tO4mWfAW/2QfYc=; b=s2ILna/4u6otuwxHVKgu93ZX3/I2LmnxLAVaiK83vqCIAOBdi7gqRm1q90MGys8A4R drayOiy5/1q6pIuWhVtDU8dveFehnUW7kXMYEwrR3dYiKGva7qk8KRotz6hVqByPSpOf JMUHjdENP9zpl9FUg6zPE7DT4OPPSjZ7jcje4hGHXvSLAaKOiOTmZVCJ+xY0zrX08deQ DGsbnnTz59fOOWPBnzdiTXp+/iseeKIdpF1w2woBnluOmPO+TGM46qlEorfW9nrF8cRJ dUsik23Z/JaY4DTiC6qGfVPl8RFZMiL9v8GW1BYHMSpzsvsxDNCoOiu6kn5iyNFFW8ol Ggbg== X-Gm-Message-State: APjAAAXSX07U5ZG0qTQ1va9KlckNyZNVKg8xCv8AK1bBXyppAKYyWWVR l2YBffodrPKTeT4KX7KZjEZqXcJV X-Google-Smtp-Source: APXvYqwU83VsWyvD+W6NCq3MbATzi5c+9E7iaSi/8/MsTkRXERrC+LL5y3XWikghD9ohuw0bocHuRg== X-Received: by 2002:a1c:61d7:: with SMTP id v206mr427670wmb.13.1574792978041; Tue, 26 Nov 2019 10:29:38 -0800 (PST) Received: from rpluim-mac ([2a01:e34:ecfc:a860:e411:a3bc:3f6:bb15]) by smtp.gmail.com with ESMTPSA id b2sm16154233wrr.76.2019.11.26.10.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 10:29:37 -0800 (PST) From: Robert Pluim To: Eli Zaretskii Subject: Re: bug#38218: network-interface-list only returns IPv4 addresses References: <8736eoiend.fsf@gnus.org> <83h82qsgjm.fsf@gnu.org> <834kyqsdi5.fsf@gnu.org> Date: Tue, 26 Nov 2019 19:29:36 +0100 In-Reply-To: <834kyqsdi5.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 26 Nov 2019 20:23:30 +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: 38218 Cc: 38218@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, 26 Nov 2019 20:23:30 +0200, Eli Zaretskii said: >> From: Robert Pluim >> Cc: 38218@debbugs.gnu.org >> Date: Tue, 26 Nov 2019 19:10:04 +0100 >>=20 Eli> It needed a bit of tweaking for mingw.org's MinGW, so that it would Eli> work on XP. However, after making the changes, one test from Eli> nsm-tests.el fails here: >>=20 >> Thanks for that Eli> Thanks for reviewing it. Thanks for writing it. The Windows handling of IP prefixes is weird, to say the least. Eli> Test nsm-check-local-subnet-ipv4 condition: Eli> (ert-test-failed Eli> ((should Eli> (eq nil Eli> (nsm-should-check "127.1"))) Eli> :form Eli> (eq nil t) Eli> :value nil)) Eli> FAILED 1/2 nsm-check-local-subnet-ipv4 (4.656250 sec) >>=20 >> Eek. mingw (or winsock) doesn=CA=BCt support getaddrinfo("127.1",...= ), >> although getaddrinfo("127.0.0.1",...) seems to work. This fixes it f= or me: Eli> For me as well, thanks. Pushed as 95e218af14. Thanks Robert From unknown Mon Jun 23 16:46:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 25 Dec 2019 12:24:04 +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