GNU bug report logs - #74907
31.0.50; nsm-check-local-subnet-ipv4 test fails on macOS with VPN enabled

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Mon, 16 Dec 2024 02:05:02 UTC

Severity: normal

Tags: fixed

Found in version 31.0.50

Fixed in version 31.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Robert Pluim <rpluim <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 74907 <at> debbugs.gnu.org, Ship Mints <shipmints <at> gmail.com>
Subject: bug#74907: 31.0.50; nsm-check-local-subnet-ipv4 test fails on macOS with VPN enabled
Date: Tue, 17 Dec 2024 13:40:02 +0100
>>>>> On Tue, 17 Dec 2024 11:26:28 +0000, Stefan Kangas <stefankangas <at> gmail.com> said:

    Stefan>     (substring (nth 3 info) 0 -1)

    Stefan> With a VPN, `info` is bound to this when I get the backtrace:

    Stefan>     ("utun0"
    Stefan>      [10 0 0 1 0]
    Stefan>      (0 . [0 0 10 255 255 255 16 2 0 0 10 0 0 1])
    Stefan>      (0 . [0 0 255 0 0 0 16 2 0 0 10 0 0 1]))

    Stefan> Without a VPN, `info` is bound to this instead:

    Stefan>     ("utun6"
    Stefan>      [65153 0 0 0 6123 19123 32345 45123 0]
    Stefan>      [65153 0 0 0 65535 65535 65535 65535 0]
    Stefan>      [65535 65535 65535 65535 0 0 0 0 0])

    Stefan> Clearly, this will not work:

    Stefan>     (substring '(0 . [1 2 3 4]) 0 -1)

    Stefan> So the question is why `network-interface-list` would return such an
    Stefan> unusual value here.

Because getifaddrs is returning bogus info for the netmask. How about this:

diff --git a/src/process.c b/src/process.c
index cd1378f07ad..4fe16ad1a85 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4351,6 +4351,7 @@ network_interface_list (bool full, unsigned short match)
 
       if (full)
         {
+	  it->ifa_netmask->sa_family = it->ifa_addr->sa_family;
           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

Robert
-- 




This bug report was last modified 150 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.