🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17468

Re: [PATCH net-next v4 3/4] selftests: net: test restricted on-link fallback

#17468
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 22:08
117 lines
12017 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] In ipv4_ping_novrf() (tools/testing/selftests/net/fcnal-
  test.sh, lines 659-662), the new case "ping out, blocked by…
- [Low] Even with the missing ping added, the unreachable-rule case in
  ipv4_ping_novrf() (fcnal-test.sh lines 659-662) has no device bind…

--

selftests: net: test restricted on-link fallback

This patch updates the IPv4 cases in fcnal-test.sh to match the new
on-link fallback behaviour. The fallback is no longer taken when the FIB
lookup hits an unreachable, blackhole or prohibit route or rule. It
changes the expected return codes, adds a route miss variant and an
unreachable rule case, and enables the device bind cases that were
previously commented out.

> diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
> index a50609535fedc..9722d7dcad085 100755
> --- a/tools/testing/selftests/net/fcnal-test.sh
> +++ b/tools/testing/selftests/net/fcnal-test.sh

[ ... ]

> @@ -643,10 +656,14 @@ ipv4_ping_novrf()
>  	run_cmd ping -c1 -w1 ${a}
>  	log_test_addr ${a} $? 2 "ping out, blocked by rule"
>  
> -	# NOTE: ipv4 actually allows the lookup to fail and yet still create
> -	# a viable rtable if the oif (e.g., bind to device) is set, so this
> -	# case succeeds despite the rule
> -	# run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
> +	log_start
> +	setup_cmd ip rule add pref 49 to ${NSB_LO_IP} unreachable
> +	log_test_addr ${a} $? 2 "ping out, blocked by unreachable rule"

[Severity: Medium]
Is a ping missing here? Nothing runs between the rule add and
log_test_addr, so $? is the exit status of setup_cmd.

setup_cmd() exits the whole script if the command fails:

setup_cmd()
{
	...
	run_cmd ${cmd}
	rc=$?
	if [ $rc -ne 0 ]; then
		...
		exit $rc
	fi
}

So when it returns here, $? is always 0. log_test_addr() then compares
0 against the expected value of 2. That means this case reports FAIL on
every run, and no packet is ever sent while the pref 49 unreachable rule
is installed.

The commit message says this case will "demonstrate ping fails as
expected with an unreachable rule" and that it "ensures
FIB_LOOKUP_REPORT_MISS does not break this behavior". As written, the
case checks neither.

Would adding run_cmd ping -c1 -w1 ${a} before log_test_addr fix this?
At this point a is still ${NSB_LO_IP}.

> +	setup_cmd ip rule del pref 49 to ${NSB_LO_IP} unreachable
> +
> +	log_start
> +	run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
> +	log_test_addr ${a} $? 2 "ping out, device bind, blocked by rule"

[Severity: Low]
Even with the ping added, can the unreachable rule case catch a
FIB_LOOKUP_REPORT_MISS regression without a device bind?

In ip_route_output_key_hash_rcu(), the on-link fallback is only taken
when oif is set and err == -ESRCH. In every other case a miss is mapped
back:

	err = err == -ESRCH ? -ENETUNREACH : err;

fib4_rule_action() returns -ENETUNREACH for FR_ACT_UNREACHABLE. With oif
unset, two cases give the same ping exit code of 2:

  - the unreachable rule is correctly reported as -ENETUNREACH
  - the rule is wrongly reported as a miss (-ESRCH), which is then
    remapped to -ENETUNREACH

So a non-bound ping cannot tell them apart.

The device bind case that follows runs after the pref 49 rule has been
deleted. It hits the pref 50 prohibit rule (-EACCES), which never goes
through the -ESRCH vs -ENETUNREACH distinction.

Should there also be a run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a} case,
expecting 2, while the pref 49 unreachable rule is still installed?

>  
>  	a=${NSA_LO_IP}
>  	log_start

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261115215640.18728-1-liamsmith827%40grapheneos.org
Technical Details
Message-ID: <179486691687.3136.3928075477419379524@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364747-linux-kernel-netdev=dewy.ru
References: <20261115215640.18728-4-liamsmith827@grapheneos.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364747-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v4 3/4] selftests: net: test restricted on-link fallback
Date: Mon, 16 Nov 2026 22:08:36 +0000
Organization: Usenet Network
Message-ID: <179486691687.3136.3928075477419379524@kernel.org>
References: <20261115215640.18728-4-liamsmith827@grapheneos.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2178607"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:c0+xjjesY4jzFOd5RNptTscp9+w= sha256:HD1fvS17uCo6ZHVtzJLCkqJCgOZDl1YwcDLCe26pT78=
	sha1:Qijdp1WSBSxG77uUNn5/zmBP84Y= sha256:JvZV44pGSwAxN9Cw5ftzBCgmFkPWxtksN2GP7vzHEwc=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id BB90C114D84; Tue, 17 Nov 2026 01:09:13 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id wxikE-5yWW5n;
	Tue, 17 Nov 2026 01:09:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-364747-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id DE3D9114D74; Tue, 17 Nov 2026 01:09:00 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 02E44601A2D; Mon, 16 Nov 2026 22:09:00 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794866924;
	b=4yS+lqsDrgSpktm0YPJTE/dths+egzOw0j6RL2SD4+eER/95RjuYHQCZh1OZlC+Ed+Xz
	 5/wnkGjYCVWNNtfdXBfOq62uJjn/rmnnpIqBq9RV7zq5lL4QG3N6RBScI1P5NW7RlLBoF
	 75vh+IBs7MUZBggb9EO9EMh9/7O6P6YpA+3299uDw2eJc5CRvYumnxDl6Og3enQkIW9Wf
	 NYxHPv7I5kjVSndYC4nMZYLjPkiltvb3KIcqyBoaShB9TUeCEPJy/UQETtBaxTREDrrTP
	 J8F9SjM4ydg1VFcPM4iErKNtGFZ6vSti7iq9JQBljHj6bZHGd8uimUtIi5N4Td73S9A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794866924;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=mJGxukNRI8guOCGYuzV7f+FvQEmBPeT2/NYqHIeuCJg=;
	b=2y/5bqjNgLj35MIlNgIjexdVPTBocUgKV0pZ5M/UU8SdfMkOi5AaiZNDfKzxOnY3U8rE
	 4EXIO6T/5ZyzcpuGx9HAqL8s1tP6q4fbksxlkbiIGGQRiUblkMDAbZ2NcLq3MzqyiiS4k
	 hr7K3qsaPNQpm93cx/y8pvMkXv4a+mXSOp5QEMybMgrRXxvBrodJyyvSH1UL4/ehN14JI
	 mbPFMUnuCa5j2U4TmZGJO03Oryywy9sa05mQHQU1FGFB3Hu0jxYGJEnQXj3QhIw+udetu
	 FAnfsv53khsSpj/SGegjjZ2mNDg8uJbff/UBf+pZ1TEFVp+0apk/0GbdhLU0hp3N8Qg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NfXOz1bj;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 49D4660A2622;
	Mon, 16 Nov 2026 22:08:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NfXOz1bj
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794866918;
	b=5VQlLOmNJYIoIbAh3kXzXMhp0zrDpVE5xShFtTYvILhqNwBoegkjBBdLKNO+6giXejUY
	 XN+9sikxxQhU9QrQGa1CiNjJ6vQwzlsBJENtLCqGW3fe/Lx/885RGmrgkUvHOo8QHB30+
	 vLzC00K0blhtoDdng3HVhLDyVvZawa/0ajn6MLJQlxfTUlHiudwPycZht8lrPyQwdbnrT
	 B4iwB99xwd6Fa782250guKoxbTQIFc3I7zPG5ReokezDSMOT0pjAoDkvtRkW1QoNkIBdM
	 LAQk3mfDmpfWzIPoVcFmxgOFxACoPTPX+gkt2piBV0UojF7hhTehqta7G7IrB0EMuLQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794866918;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=mJGxukNRI8guOCGYuzV7f+FvQEmBPeT2/NYqHIeuCJg=;
	b=Z0LfqKUP7H5+N78oOoxBDJZIFi6pQaXAmvWDlVzfo9gcunFEnALGXRYcaWNxQ0dgbRB2
	 pIizK0cIJnh7IAF7frkMHoipnHxhexZKnSP3e/drHzG4D6Mr4KTyXzZoHnEOhsPeNrJ4P
	 Ee+k5ZTcW6dPEDAQNQLCfKSjiUYgJ20G62OB36JcW69b3+CmIk77pYauKGydW7ORZ5yYA
	 FmCCpCXS9W4uZF4QF2au38tsNYpUlhHFENsJhQ2rw86eOnihrMTS4lD5PEqdK9NUlv+/I
	 nEeRV69CFIpLhSQnnwFv9Y81v6UaeGKYVvBPi/m+sAR5MFnNXz7Ym0YSdH+TD0Y/FqA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NfXOz1bj;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68C3660A2621;
	Mon, 16 Nov 2026 22:08:38 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50D191F000C6;
	Mon, 16 Nov 2026 22:08:37 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794866918;
	bh=mJGxukNRI8guOCGYuzV7f+FvQEmBPeT2/NYqHIeuCJg=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=NfXOz1bjnqQSic7caaDvifzS7e6EoeeDqYbBHCqBxf1odgHUmampewXS3miJugkWs
	 q3WIh6032Q8hXhTeTAOczJwAwJfuoEEah1rLLjST68py2Hfu0YloCFIq31+H3kG5Bl
	 YsMu5imNqWR0st9EuhnoXYXMSrk3BkOWw4eFtlDu7DY1J6O8VZ4JNWYI5LM3TXe5qK
	 ybo42DBAkOnRL1HFbsgrf7ZGMd/rf3kWcWVOX5UtGKZVnojc+E7/fLCpQIACgL526h
	 S3tdgTO6skVx0F/+bc4JUeS5362Nhm28eiwfLsoi+Bex4E3OcZ8dvTVOb+MYDSs1/t
	 tkX61uyi8vUeQ==
X-Cc: netdev@vger.kernel.org, dsahern@kernel.org, idosch@nvidia.com,
 davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 horms@kernel.org, shuah@kernel.org, linux-kselftest@vger.kernel.org,
 linux-kernel@vger.kernel.org, liamsmith827@proton.me
X-In-Reply-To: <20261115215640.18728-4-liamsmith827@grapheneos.org>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list