From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim 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 13:40:02 +0100 Message-ID: <87h6724h5p.fsf@gmail.com> References: <87o71b6gmd.fsf@gmail.com> <87y10e4v7d.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36812"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74907@debbugs.gnu.org, Ship Mints To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 17 13:42:39 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 1tNWuM-0009QS-Lh for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Dec 2024 13:42:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNWtw-0005Bi-KF; Tue, 17 Dec 2024 07:42:12 -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 1tNWtq-0005Ay-5v for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2024 07:42:06 -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 1tNWtn-0003QG-Ss for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2024 07:42:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=TP7KITOhOp/vwUmMIO/xpHRE99Hc4SPj4hMzDo/b06A=; b=mv07Tf8t7qcL9kkt0x0eorRJDSXpWkFpsb8p6fUJlaJWWhStAxHU+C8G0zF4+D4pnBblKghb+RmtFl6QVp6JBg+tQh3w5bduo6MzujX9MNM6FHDD/njA2tR/QnVCAku5cK+caYyTYI3inDqaKb4gTKtuRv7GFH/A3z/JsHuVkGi+z2oo/wxrIDmsV8c09doSuL9E4knVgicp+8x/XE+z1HYsuZVJUVFQSVNU7aY9DB/xmS5HvgzVbcd5hu4+rI0/osrOSPC8eyVNrdOlxHpiOyW4GlEBBPs5Mh6ubQRcqwpMLuELc3F/64C52TL/dAVF4jaHZ3ZP7cbTd41bBHYV7g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tNWtl-0005cO-Nn for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2024 07:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Dec 2024 12:42:01 +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.173443926721515 (code B ref 74907); Tue, 17 Dec 2024 12:42:01 +0000 Original-Received: (at 74907) by debbugs.gnu.org; 17 Dec 2024 12:41:07 +0000 Original-Received: from localhost ([127.0.0.1]:57900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNWst-0005ax-96 for submit@debbugs.gnu.org; Tue, 17 Dec 2024 07:41:07 -0500 Original-Received: from mail-wm1-f42.google.com ([209.85.128.42]:46445) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNWsr-0005ap-5h for 74907@debbugs.gnu.org; Tue, 17 Dec 2024 07:41:05 -0500 Original-Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-434a766b475so55575355e9.1 for <74907@debbugs.gnu.org>; Tue, 17 Dec 2024 04:41:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734439204; x=1735044004; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=TP7KITOhOp/vwUmMIO/xpHRE99Hc4SPj4hMzDo/b06A=; b=I4sepNxcf0POHWSw31Xrem1ZJy7aykYrlg1QGARhN+wEhVW1OGplCW5EdCY/L9hGqX UMxGSCqVdlrRaJQIr7vpaIR0CqQZTtMfyaHFrBG1O4Z6e4XDuSeA5v8OX/DfNsRVO1M/ 4oay/4km7htgPDNma//dFmpzqa5L52wWTbpieI/DneiNoHNyqKEvw6GxSLM3ptwj/kOs Xqit5hoUjU1WAtJWqpSkGhmGvqlg0NHyDB/G61d4HE3AR+LYfYl/fCPUrOW4lYbGkj7s n79LDPNKGHXDdyQH43YxF0hN+S/k6iHTsfCIOliEkjDds5TVN2c+/9mvN3qMRc06c2TN DzgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734439204; x=1735044004; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TP7KITOhOp/vwUmMIO/xpHRE99Hc4SPj4hMzDo/b06A=; b=uI3S4vtVS2bPYTo3s51yXBrBSdKxzW6cR18t+3fmdAzfwS6bwL4TXtNIkM0J82EBsH SEMna0j+ngMvkWWE9pfy/pQ9BPSudJAJcSUycZcPT2xnrLoIyQRskLazkXw/VeWblvgt Hy7MAnYakq1VgwanHuUHIv8fqxbE2k4hNAGmHoMR5iJJLW7Iy/hLYul1HabWqzt7rwhr 9TQ0dWmT5FSM3Ff+hrRFMfPrR/WOPmRrc/twIOSdKaJgdwp59324Cugudtvlqan3iMcQ R4ESNnIYf8vjlec/DcpyvYZCORiGk/wyuvUMUgGaInpKHCavei+fr4r/1qcZO7qwvVqB AKLw== X-Forwarded-Encrypted: i=1; AJvYcCV5GFs8jJRpHbUxNzBKFLIerg0KkjIvrwUN5Wh3/Cx0EugOKEnXtp+trfSxCqnPJDkX3P5gwg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyzbbQK5rI5+mVH8nyZl7QZ9weO8PHtKi60FS1ITcBtnPa3Otii 6WZzpRclyUjLfTJ122iiukyXbkNa8hImUSZuB8FFgCFcogiaM0eI8cXwxQ== X-Gm-Gg: ASbGncs7ZpbVX/XY7kl5EfSn9Atzl84+7yF1aOsMFyHMcwej6UN6ec990ZP9nB0Jmx5 RZd63JGhFUune38MIrv1HIsI8bqCy+21EAOkUzvoaeD85mlTipnNJfe8pXP573I5C8j/c1ZPaQM AIH5DiUEob0bbqKmmUkrO2Vtl9bLDnxB12oJcO/VviNeVbxd4CWCGm5Jkjd/5rQ8wNPg5ySjttw rmxu1iKOToGZqB92AnS4Lhmzx3t4zt1dfpkH04B3khB X-Google-Smtp-Source: AGHT+IGHz7mQSUvwO/k++EOoA/LqedbggZXTrHNSnjcXKQKfbZhGVpfpVyhyg14O7wiZc5kiItBJ6A== X-Received: by 2002:a05:600c:1f1b:b0:434:fa73:a907 with SMTP id 5b1f17b1804b1-4362aa2f0abmr163873815e9.13.1734439203522; Tue, 17 Dec 2024 04:40:03 -0800 (PST) Original-Received: from rltb ([2a01:e0a:3f3:fb51:9db7:abd4:e7ac:ea0b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4363601406esm116375855e9.3.2024.12.17.04.40.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 04:40:03 -0800 (PST) In-Reply-To: (Stefan Kangas's message of "Tue, 17 Dec 2024 11:26:28 +0000") 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:297272 Archived-At: >>>>> 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 Robert --