🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27485

Re: [PATCH net-next v3 13/13] selftests: net: ipvs: check a PMTU learned after the DR route was cached

#27485
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 19:21
213 lines
15555 bytes
Thank you for your contribution! Sashiko AI review found 5 potential
issue(s) to consider.

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

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] test_dr_v6_pmtu() in
  tools/testing/selftests/net/netfilter/ipvs.sh can pass on a kernel…
- [Low] The new top-level `checktool "python3 -c pass" "run test without
  python3"` in tools/testing/selftests/net/netfilter/ipvs.sh runs before…
- [Low] The commit message carries the trailer 'Co-Authored-By: Claude
  Sonnet 5.5 <noreply@anthropic.com>'.
- [Low] The header comment of udp_send_v6() in
  tools/testing/selftests/net/netfilter/ipvs.sh says it sends 'one UDP…
- [Low] test_dr_v6_pmtu() in
  tools/testing/selftests/net/netfilter/ipvs.sh never checks the exit…

--

selftests: net: ipvs: check a PMTU learned after the DR route was cached

This adds an IPv6 DR mode test to ipvs.sh. The test caches the director's
route to the real server, forges a packet too big message so the director
learns a PMTU for the real server, and then checks that an oversized
datagram gets a packet too big message back to the client. It also adds
CONFIG_IP_VS_IPV6 and CONFIG_IP_VS_PROTO_UDP to the netfilter selftest
config.

> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

[Severity: Low]
This isn't a bug, but Co-Authored-By is not in $signature_tags in
scripts/checkpatch.pl. Running checkpatch on this patch will warn
"Non-standard signature: Co-Authored-By:".

Documentation/process/coding-assistants.rst in this tree does not define an
AI attribution trailer. It also forbids an AI Signed-off-by, so
Co-developed-by can't be used either.

Could the attribution follow a convention the maintainers accept, or move
below the --- line?

> diff --git a/tools/testing/selftests/net/netfilter/ipvs.sh b/tools/testing/selftests/net/netfilter/ipvs.sh
> index 9c9d5b38ab712..556ce071035ec 100755
> --- a/tools/testing/selftests/net/netfilter/ipvs.sh
> +++ b/tools/testing/selftests/net/netfilter/ipvs.sh

[ ... ]

> @@ -54,6 +60,7 @@ fi
>  
>  checktool "ipvsadm -v" "run test without ipvsadm"
>  checktool "socat -h" "run test without socat"
> +checktool "python3 -c pass" "run test without python3"

[Severity: Low]
On a system without python3, does this skip the existing IPv4 DR, NAT and
tunnel tests as well? checktool() in netfilter/lib.sh exits the whole
script:

checktool (){
	if ! $1 > /dev/null 2>&1; then
		echo "SKIP: Could not $2"
		exit $ksft_skip
	fi
}

The IPv4 tests only need socat, and before this patch they ran without
python3. Only test_dr_v6_pmtu() uses python3, through udp_send_v6() and
send_ptb_v6().

Could the python3 check move into test_dr_v6_pmtu() so that only that test
is skipped?

[ ... ]

> @@ -169,6 +176,74 @@ test_tun() {
>  	test_service
>  }
>  
> +# Send one UDP datagram of ${2} bytes from the client to the IPv6 service and
> +# keep the socket open for a moment, so that a packet too big message for it
> +# is accepted.
> +udp_send_v6() {
> +	ip netns exec "${ns0}" python3 -c '
> +import socket, sys, time
> +s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
> +s.bind((sys.argv[1], 0))
> +s.sendto(b"x" * int(sys.argv[3]), (sys.argv[2], int(sys.argv[4])))
> +time.sleep(0.5)
> +' "${cip_v6}" "${vip_v6}" "${1}" "${port}"
> +}

[Severity: Low]
This isn't a bug, but the comment says the datagram is ${2} bytes. The size
actually comes from ${1}, which is passed as sys.argv[3]. Should the comment
say ${1}?

[ ... ]

> +test_dr_v6_pmtu() {

[ ... ]

> +	ip netns exec "${ns1}" ip addr add "${vip_v6}/128" dev lo nodad
> +	ip netns exec "${ns1}" ipvsadm -A -u "[${vip_v6}]:${port}" -s rr
> +	ip netns exec "${ns1}" ipvsadm -a -u "[${vip_v6}]:${port}" \
> +		-r "[${rip_v6}]:${port}" -g

[Severity: Low]
What happens here if ip_vs was built without CONFIG_IP_VS_IPV6? Neither
ipvsadm call has its exit status checked, so the test carries on with no
service.

The datagrams to vip_v6 would then be delivered locally in ns1. Nothing
listens on the port there, and they are never forwarded to the real server.

The first check still passes. ns1 learns the PMTU from the forged packet
too big through icmpv6_err()->ip6_update_pmtu(), without IPVS being
involved.

The second check then reports "FAIL: director kept using a route that
bypasses the learned PMTU", which points at route caching instead of the
missing IPVS feature. The config fragment in this patch covers CI builds,
but other configs would hit this.

Should a failed ipvsadm call make the test skip, or fail with a message
that names the real cause?

> +
> +	ip netns exec "${ns2}" ip addr add "${rip_v6}/64" dev veth21 nodad
> +	ip netns exec "${ns2}" ip addr add "${vip_v6}/128" dev lo nodad
> +
> +	# Let the director cache its route to the real server
> +	udp_send_v6 100
> +
> +	send_ptb_v6 1280
> +	sleep 0.2
> +	if ! ip netns exec "${ns1}" ip -6 route get "${rip_v6}" | grep -q "mtu 1280"; then
> +		echo "FAIL: director did not learn the PMTU of the real server"
> +		return 1
> +	fi
> +
> +	# A datagram that exceeds the PMTU must be answered with a packet too
> +	# big message, which gives the client a PMTU for the service
> +	udp_send_v6 1400
> +	if ! ip netns exec "${ns0}" ip -6 route get "${vip_v6}" | grep -q "mtu 1280"; then
> +		echo "FAIL: director kept using a route that bypasses the learned PMTU"
> +		return 1
> +	fi
> +}

[Severity: Medium]
Can this test pass on a kernel that lacks the ip6_dst_check() behaviour it
is meant to cover?

setup() brings up veth10 and veth12 in ns1 and then waits only one second:

	ip netns exec "${ns1}" ip link set veth10 up
	...
	ip netns exec "${ns1}" ip link set veth12 up
	...
	sleep 1

setup_ns() does not disable accept_dad, so the link-local addresses on
veth10 and veth12 are still tentative at that point.

addrconf_dad_kick() waits a random delay of up to rtr_solicit_delay (1s)
before the first NS. DAD succeeds RETRANS_TIME (1s) after that, so each
interface finishes DAD somewhere between 1s and 2s after link up.

When DAD completes, addrconf_dad_completed() calls rt_genid_bump_ipv6().
__ipv6_ifa_notify() then inserts the host route with ip6_ins_rt(), and
fib6_add() bumps the generation again.

ip6_dst_check() checks the generation before it gets to the exception
check:

net/ipv6/route.c:ip6_dst_check() {
	...
	if (!rt6_is_valid(rt))
		return NULL;
	...
			     rt6_uncached_clone_superseded(rt, from)))
	...
}

Suppose an ns1 link-local address finishes DAD after "udp_send_v6 100" and
before "udp_send_v6 1400". The cached dst then fails the check for an
unrelated reason.

__ip_vs_get_out_rt_v6() looks the route up again through
ip6_route_output() and picks up the 1280 MTU exception. The client gets a
packet too big message whether or not rt6_uncached_clone_superseded()
works.

The window between the two sends runs from roughly 1.1-1.6s to roughly
2.0-2.6s after link up. That covers most of the DAD completion range for
both ns1 interfaces, so a false pass seems likely on most runs.

Would setting accept_dad=0 in ns1 before the links come up make this
deterministic? Another option is to wait until
"ip -n $ns1 -6 addr show tentative" is empty before the first
udp_send_v6.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201174021.7211-1-dsahern%40kernel.org
Technical Details
Message-ID: <179649846281.3148.13079176381668961620@kernel.org>
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378109-linux-kernel-netdev=dewy.ru
References: <20261201174021.7211-14-dsahern@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378109-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v3 13/13] selftests: net: ipvs: check a PMTU
 learned after the DR route was cached
Date: Sat, 05 Dec 2026 19:21:02 +0000
Organization: Usenet Network
Message-ID: <179649846281.3148.13079176381668961620@kernel.org>
References: <20261201174021.7211-14-dsahern@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3103644"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:bvKd5RzOwlSQyk3xUGUgKcY7Y8w= sha256:BtHK5002rM/Yy2+UGWIa6QRhx+5jVRgZmv3wtqhlLz4=
	sha1:6bCR+jGe3/KbB0Ie9jydP3BAdsg= sha256:BA/rxNqviAUZGx9KMO47uCdYjXS84k98KbgiFr+Cpo0=
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 CC493117E9A; Sat,  5 Dec 2026 22:21:36 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.539
X-Spam-Status: No, score=-3.539 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.14, 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 37bn4i8dQRyY;
	Sat,  5 Dec 2026 22:21:33 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-378109-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 3C642117E93; Sat,  5 Dec 2026 22:21:25 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 15C05327D4; Sat,  5 Dec 2026 19:21:05 +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=1796498465;
	b=eVdy3udU67voRiHO9yRX6ecE/Vv/YBOegab7rlYbOpDOKy5YfMyZA4p8SwevI+HfnSGb
	 +m8ubqRaszWuTbPxz69Fg0YQHcM6Z58jIhtI/oASRlO9Oh9uS5WIjuJTZy1Xk7hPNxis0
	 /YUwREBxSZYm98NUWFYzv0PNGGo09K7Bz5crOmEBAmRKO7icAgazZZxZAfVfVKjVFNhwC
	 pGKhEy2M+D8Asyhj8UlWgzlEsvO/2Ac68OXWNkHEqy+xphcwCMHWUczy5uYgR5Q+F7SFA
	 HrCC+RNCUxJw0rmyehWLDNRPXJdNEooSUOMDp3oMpxnkXJljMNjob1X8OfQQePLAZCQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796498465;
	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=pCJ3vOAFvF3CEL8dqDsGS/xXtT3S5Cv6wbAFC/lELL0=;
	b=yr18RpFpCUsnnrzBWshZ0+nO27jNuAzCokoEw/8x+mfFINLD2q8o2q2+/06xxkfxUksR
	 JwtOngDUCyJDsVhSNolc+l3m9x7Df0Vi6SvVGzYQgKLTKOa+kt2kzD6FOOKy9TNl16DH3
	 e2Bl8CyPp111BD/opnsbKRsNbPIAftL1nqVSEfsPqWWKYrl+d/usxa0lLNpjIRUJNoISf
	 COdJmebdYEFItH0XGTV+gaGeGTSqoT5NqjFvYYkf8R98nLmxsZ34LT/lU4uz9AzGotgv3
	 /WrFUAM3b2k0MrhyOhIWpyBhE22438RhaTSEsdcxdTJKRy0AXZBcHviMZ3uo+HrMzXA==
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=Tg6bpULv;
	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 E0022606A335;
	Sat,  5 Dec 2026 19:21:04 +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=Tg6bpULv
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=1796498464;
	b=4IaXec425Z4uqFOAXJDgyqJlJ5HveIDdYntYe1kPwUODfD1H9R3eLL9mA1+FIjPy5kpy
	 kstdYtPukrK7dGmMgP2aYjQpYR5Nr9LgtUvuO+I0x1+DWwBjn/j+EfplHCE3E9SHrVjPW
	 R/LWqW3eVNZNgVm2j9J6zNwQFDe0x910JnL+nkfkgkr7IBKFp6CD7vIBg3e5oGJP9gvPC
	 eMg7Z5fy1XAHX9e4RwyXm81lsl1i873ITqpwcQ4Zptq21FbeTYZfbWNVut779m+xHb1/R
	 /T4heTbX80dB9w7X5jv9EPUMpeeFujRsG+LZPBfcvHPxDP5oU7d1I0wzAe1IZEq+f/g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796498464;
	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=pCJ3vOAFvF3CEL8dqDsGS/xXtT3S5Cv6wbAFC/lELL0=;
	b=g5308lAt4VYhaAJxWN6MCldT7AHtiVg3UTQrvqC+ntk2vI3eR/oijbBRU5jirpiH17X9
	 1r0IdYjLx9jE1n8Ys8+DeNoTCWcJZiXG2uAghk7k8xnUUniUZ6VmD2vqDSjAQt4utKeLS
	 g3CDVKgVFgJrVGx19oc5+QUlW//CvE4ST84ntHzFmwVOF13nSueTV5cjyfuIKuFAQ2koS
	 F1T9zTkT8On4HCZIBKcY1ZyHu/OpLSCYoEC7H+aTO0vy928VArqVyVg0UDLDiGhfkjf0A
	 YmvNCw66Fj4IKk8wVihwROoT++hQPi0WXwKWz5FPsUi7vNSiIquKzddF8rHe5OGAW1A==
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=Tg6bpULv;
	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 0C1C1606A322
	for <netdev@vger.kernel.org>; Sat,  5 Dec 2026 19:21:04 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40DEC1F0092B;
	Sat,  5 Dec 2026 19:21:03 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796498463;
	bh=pCJ3vOAFvF3CEL8dqDsGS/xXtT3S5Cv6wbAFC/lELL0=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Tg6bpULvvxgqg/ZCMNDPqCmMQRZBIwN1sCSZqJnUJ4EGNer0BiEwCi+T0rOHycfJf
	 EZJKYHvqWBhzy4RjR5ISSe3q4C7s5iaQWSFgl1G1F9oPGDfdBkX7AwprT3R0EplBt8
	 cJn4GppJHXrdMc7VJ4w8D5yN3NAwZNF9T8MTOp+CeIDORDNdiPssaiQ2U+JjQyUPT3
	 lW3JqaNPOUYKoRMowd8+AmRybLLTMaDdCgV8h20g1RiGy391FRr1/AAI36aqciifCa
	 rzSoggieYDVUXk44ybMl1HS+O+SXzNno4DNCvx0ID88AHRx6LKFmIts01pmFl4vq2O
	 Yt2sPGjhwhZgg==
X-Cc: netdev@vger.kernel.org, idosch@nvidia.com, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
 ralf@mandelbit.com, ja@ssi.bg, dahern@nvidia.com, noreply@anthropic.com
X-In-Reply-To: <20261201174021.7211-14-dsahern@kernel.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