Subject: bug#74907: 31.0.50; nsm-check-local-subnet-ipv4 test fails on macOS with VPN enabled

From: Robert Pluim <[email-masked]>
Date: Tue, 17 Dec 2024 08:36:38 +0100

>>>>> On Mon, 16 Dec 2024 21:55:33 +0000, Stefan Kangas <[email-masked]> said:

    Stefan> I don't see a difference there.

    Stefan> ;; With VPN
    Stefan>     (network-lookup-address-info "localhost")
    Stefan>     => ([0 0 0 0 0 0 0 1 0] [127 0 0 1 0])

    Stefan>     (network-lookup-address-info "127.0.0.1")
    Stefan>     => ([127 0 0 1 0])

    Stefan> ;; Without VPN
    Stefan>     (network-lookup-address-info "localhost")
    Stefan>     => ([0 0 0 0 0 0 0 1 0] [127 0 0 1 0])

    Stefan>     (network-lookup-address-info "127.0.0.1")
    Stefan>     => ([127 0 0 1 0])

In an interactive session or -batch?

Anyway, hereʼs a wild stab in the dark based on the only code path I
could see that would give your original output. If that works Iʼd like
to know which VPN client youʼre using so I can avoid it 😀

diff --git a/src/process.c b/src/process.c
index cd1378f07ad..7f14db31c43 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4764,13 +4764,17 @@ DEFUN ("network-lookup-address-info", Fnetwork_lookup_address_info,
     {
       for (lres = res; lres; lres = lres->ai_next)
         {
-#ifndef AF_INET6
-          if (lres->ai_family != AF_INET)
-            continue;
+	  /* Avoid converting non-IP addresses (Bug#74907).  */
+	  if (lres->ai_family == AF_INET
+#ifdef AF_INET6
+	      || lres->ai_family == AF_INET6
 #endif
-          addresses = Fcons (conv_sockaddr_to_lisp (lres->ai_addr,
-                                                    lres->ai_addrlen),
-                             addresses);
+	      )
+	    addresses = Fcons (conv_sockaddr_to_lisp (lres->ai_addr,
+						      lres->ai_addrlen),
+			       addresses);
+	  else
+	    continue;
         }
       addresses = Fnreverse (addresses);
 
Robert
--