From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#74907: 31.0.50; nsm-check-local-subnet-ipv4 test fails on macOS with VPN enabled Date: Tue, 17 Dec 2024 12:45:26 +0000 Message-ID: References: <87o71b6gmd.fsf@gmail.com> <87y10e4v7d.fsf@gmail.com> <87h6724h5p.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14593"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74907@debbugs.gnu.org, Ship Mints To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 17 13:47:26 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tNWyz-0003ih-Gg for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Dec 2024 13:47:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNWyf-0007Aa-Op; Tue, 17 Dec 2024 07:47:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNWyc-0007AE-Vc for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2024 07:47:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNWyc-0004Hl-Mt for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2024 07:47:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:MIME-Version:References:In-Reply-To:From:To:Subject; bh=uwIwpTaIUGAN4Wf+ZLqK48hd6/RlWrIHkcmUQoFA7jI=; b=N6CZkUpixlDtPx+Om9JzwncwkfRzUc4AroQNaC8xgvMRCSxrtfZ2HIezW55/1gkVWsKBVpSZ9+r7u2OXl5Gtio/RvzBD7IZodV+nfI25mXuOLP4ECpI3IX6/zkRRyIa25jCEqyRrNOW8Z5LsAISoKwXnKRW/jVKENYssnILvmwTl/+UcuwdKByeZta5bbBF3b865MtRTlEvG3tObuha7lwZ4K7MEeiCt4oi8apeDuQBSz7LZ8FtGjlyVqHs+iog2GgMq+jl+XO25cXjgUVSfHl6MHC4hKBAbU01u225BDwzpQ7jh3AN3MqLyVA9I21Ytvl/VQVFyUEstMY2Ef4fmWA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tNWyc-0005rr-Ha for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2024 07:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Dec 2024 12:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74907 X-GNU-PR-Package: emacs Original-Received: via spool by 74907-submit@debbugs.gnu.org id=B74907.173443959522514 (code B ref 74907); Tue, 17 Dec 2024 12:47:02 +0000 Original-Received: (at 74907) by debbugs.gnu.org; 17 Dec 2024 12:46:35 +0000 Original-Received: from localhost ([127.0.0.1]:57914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNWyA-0005r1-Nf for submit@debbugs.gnu.org; Tue, 17 Dec 2024 07:46:35 -0500 Original-Received: from mail-ed1-f45.google.com ([209.85.208.45]:45063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNWy8-0005qa-Su for 74907@debbugs.gnu.org; Tue, 17 Dec 2024 07:46:33 -0500 Original-Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5d122cf8dd1so8841005a12.2 for <74907@debbugs.gnu.org>; Tue, 17 Dec 2024 04:46:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734439527; x=1735044327; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=uwIwpTaIUGAN4Wf+ZLqK48hd6/RlWrIHkcmUQoFA7jI=; b=FIxeGTn8Zn9gTQGOobEeWxgXVSPAQ3OIiX7AXHZ7k6Xn9LkmpQIG0yMzFtPu3lZlbJ vDUldj5SnR44YkIhJtEG2Q/F8agPYYiF025OLbAYsuvQMcawnDDiE03UOEDcxXqttEzb AkkMwM7dWoTjPd2GNoFHCEXhPXGNOcn3oxOjDXoMbImL8vN0cuaTWS1WxJkbmSTnQZOl pHyCxJxYY4iOMeGwvjiOy2HSVSxndKuoCgPsJlyaBkL58CHRzh3RzVWiEf2nUqzD6RJY DTYwsxGvxF0cbtccjevQUEvuPgmkG7yIOTo+QFqFysxolsRKvn1FZDCz3xsHQOvmEcGz hnuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734439527; x=1735044327; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uwIwpTaIUGAN4Wf+ZLqK48hd6/RlWrIHkcmUQoFA7jI=; b=V2pPcH2l2aVYBYEFYdJVQZy2cwnEi5aAnwhGhIN1tRR2iAcx/Yi5iRjWSk4Wa5jpKl PFgM7SGYkoNNrwjjQeLmmYWRYVd3jziE7/oxy00M69tprqAAvHiaqw5MISoDHoqcxK8x P2eU8+tXGTY0dcOYITi2ukEaH9reBX+iPtXM0kgypxuYO4UGYxW7SEeoPgAkpQZPy2sA kLJn7HeactD9JW8KDCci/iJGLYXnKxTBU9aEoGW2tD9WC0XfaQZug3HqBRazoEaBbRS3 vS+tdzOu/LdOBvRblIWEs0O6rOxXePQJgGAeuj/2befupSVg4Ax0owh7hwCKxyenOyBA ztQA== X-Forwarded-Encrypted: i=1; AJvYcCWiW1r+TllqK+EpgFOpVoaiK3/3PLX3kRlU9M5X22gHAcq83jGP+hbjLrf1mZXp4EMWgVT9oQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Ywbhs4zLduNRsE2bEa6CmnpOJiVDiDoP28r5D8bQ5xH9brWeqf5 pCtMIpzPPCJI5D3qe8vY7BEYa2SFvvkesMQ/LRprrZcNA+U/pyeM0mwm+tAymGU30xiT35i4AlY 8RKHkC/YEIVoT/uRbDJuj9Fc3pcY= X-Gm-Gg: ASbGncv396XkdSPyKQvJ8+CPvImSSY60g/pxMuTDiWncBGQIxTkXFnb0D5xlWQJp7Za 5DYuPzPiCkgVQ4ASpDGskiRs6dbLvMuYKZaqulw== X-Google-Smtp-Source: AGHT+IGuCEfKdUNzApiR7Yzfgb5u4PFF6o3Ys9qKour1+17xQAKg6kJjdBx3AfvEXyMytjVW9r6kw8k/DtOnGJWrICQ= X-Received: by 2002:a05:6402:2695:b0:5d2:728f:d5f8 with SMTP id 4fb4d7f45d1cf-5d7d40dbd9dmr3472223a12.27.1734439526932; Tue, 17 Dec 2024 04:45:26 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 17 Dec 2024 12:45:26 +0000 In-Reply-To: <87h6724h5p.fsf@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297273 Archived-At: Robert Pluim writes: >>>>>> On Tue, 17 Dec 2024 11:26:28 +0000, Stefan Kangas 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 Thanks, that fixes the issue. Tested with and without VPN on macOS.