Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: liamsmith827@grapheneos.org
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
Subject: Re: [PATCH net-next v4 3/4] selftests: net: test restricted on-link fallback
Date: Mon, 16 Nov 2026 22:08:36 +0000	[thread overview]
Message-ID: <179486691687.3136.3928075477419379524@kernel.org> (raw)
In-Reply-To: <20261115215640.18728-4-liamsmith827@grapheneos.org>

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

  parent reply	other threads:[~2026-11-16 22:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 21:56 [PATCH net-next v4 0/4] ipv4: restrict on-link fallback to lookup misses liamsmith827
2026-11-15 21:56 ` [PATCH net-next v4 1/4] ipv4: add FIB_LOOKUP_REPORT_MISS liamsmith827
2026-11-15 21:56 ` [PATCH net-next v4 2/4] ipv4: restrict on-link fallback to lookup misses liamsmith827
2026-11-16 22:08   ` netdev-bot+sashiko
2026-11-15 21:56 ` [PATCH net-next v4 3/4] selftests: net: test restricted on-link fallback liamsmith827
2026-11-16  8:59   ` Ido Schimmel
2026-11-16 20:27     ` liamsmith827
2026-11-16 22:08   ` netdev-bot+sashiko [this message]
2026-11-15 21:56 ` [PATCH net-next v4 4/4] ipv4: replace obsolete routing comment liamsmith827

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

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

  git send-email \
    --in-reply-to=179486691687.3136.3928075477419379524@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=liamsmith827@grapheneos.org \
    --cc=liamsmith827@proton.me \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox