unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: 74907@debbugs.gnu.org, Ship Mints <shipmints@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	[thread overview]
Message-ID: <87h6724h5p.fsf@gmail.com> (raw)
In-Reply-To: <CADwFkmmp2V8HVEgO-ZuY0KFzubN-iO4YVa82V0ik8MHbnfw1uw@mail.gmail.com> (Stefan Kangas's message of "Tue, 17 Dec 2024 11:26:28 +0000")

>>>>> On Tue, 17 Dec 2024 11:26:28 +0000, Stefan Kangas <stefankangas@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
-- 





  reply	other threads:[~2024-12-17 12:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16  2:03 bug#74907: 31.0.50; nsm-check-local-subnet-ipv4 test fails on macOS with VPN enabled Stefan Kangas
2024-12-16 10:56 ` Robert Pluim
2024-12-16 11:23   ` Ship Mints
2024-12-16 11:46     ` Robert Pluim
2024-12-16 21:55     ` Stefan Kangas
2024-12-17  7:36       ` Robert Pluim
2024-12-17 11:26         ` Stefan Kangas
2024-12-17 12:40           ` Robert Pluim [this message]
2024-12-17 12:45             ` Stefan Kangas
2024-12-17 12:57               ` Robert Pluim
2024-12-17 13:11                 ` Ship Mints
2024-12-17 13:14                   ` Ship Mints
2024-12-17 13:30                   ` Robert Pluim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h6724h5p.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=74907@debbugs.gnu.org \
    --cc=shipmints@gmail.com \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).