๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23217

Re: [PATCH net-next v2 11/12] selftests: net: add amt_v6.sh for an IPv6 outer transport

#23217
From: netdev-bot+sashiko
Date: Thu, 26 Nov 2026 19:17
139 lines
13268 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 2 ยท 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] probe_v6_relay() in tools/testing/selftests/net/amt_v6.sh is
  meant to skip in one case it cannot recognise.
- [Medium] selftests: net: probe_v6_relay() fails instead of skipping
  without CONFIG_AMT
- [Low] The commit message overstates how closely amt_v6.sh mirrors
  amt.sh.

--

selftests: net: add amt_v6.sh for an IPv6 outer transport

This adds amt_v6.sh, a variant of amt.sh in which the AMT gateway and
relay use an IPv6 outer link, with a second gateway on the same link.
It checks discovery through a secondary relay address, IPv4 and IPv6
multicast forwarding, tunnel MTU handling, that a Discovery sent to
ff02::1 gets no answer, and rediscovery after down/up. A probe skips the
test when the kernel or iproute2 lacks IPv6 AMT support.

> amt_v6.sh is amt.sh with the gateway<->relay link moved to IPv6, and a
> second gateway on that link:

[ ... ]

> The namespaces, inner addresses and smcroute (S,G) routes are those of
> amt.sh, and the scripts use the same tools, plus jq.

[Severity: Low]
Is "plus jq" accurate? amt.sh already uses jq in test_remote_ip() and
test_query_egress().

Also, amt_v6.sh does not carry over test_query_egress() from amt.sh.
That test installs clsact and flower egress counters on amtr for IGMP
(ip_proto 2) and MLD query (ICMPv6 type 130) packets, and it fails if a
relay General Query leaves through the amt device. The
send_mcast_torture4 and send_mcast_torture6 runs are not carried over
either.

This series adds the IPv6-outer General Query path:

  amt_send_igmp_gq() / amt_send_mld_gq()
    -> amt_send_membership_query()

Should the egress check be added here as well? If not, could the commit
message say that these checks were dropped, instead of describing the
script as amt.sh with the link moved to IPv6?

> diff --git a/tools/testing/selftests/net/amt_v6.sh b/tools/testing/selftests/net/amt_v6.sh
> new file mode 100755
> index 0000000000000..9d3e4a20676c3
> --- /dev/null
> +++ b/tools/testing/selftests/net/amt_v6.sh
> @@ -0,0 +1,355 @@

[ ... ]

> +# An iproute2 without IPv6 AMT support either rejects the address or packs
> +# it into the 4-byte IFLA_AMT_LOCAL_IP, which this kernel refuses and an
> +# older one takes as an IPv4 address. A kernel without IPv6 AMT support
> +# ignores IFLA_AMT_LOCAL_IP6 and asks for a local address. Skip in those
> +# cases only.
> +probe_v6_relay()
> +{
> +	local err got
> +
> +	if ! err=$(ip -n "$RELAY" link add amtprobe type amt mode relay \
> +		   local "$RELAY6" dev br_gw 2>&1); then
> +		case "$err" in
> +		*"Local attribute is required"*|*"expected rather than"*|\
> +		*"IPv6 address in an IPv4 attribute"*)
> +			echo "SKIP: no IPv6 AMT support: $err"
> +			exit "$ksft_skip"
> +			;;
> +		esac
> +		echo "FAIL: cannot create an IPv6 relay: $err"
> +		exit "$ksft_fail"
> +	fi

[Severity: Medium]
Does this also skip when the amt link type is not available at all?

On a kernel built without CONFIG_AMT, or where the amt module cannot
be loaded, rtnl_link_ops_get() finds no "amt" ops and __rtnl_newlink()
returns -EOPNOTSUPP with the extack "Unknown device type". An iproute2
that does not know the amt link type at all rejects the command line
before anything reaches the kernel.

Neither error text matches any of the three case patterns. In both
cases probe_v6_relay() prints "FAIL: cannot create an IPv6 relay" and
exits with ksft_fail. A kselftest run on a config without AMT would
then report a failure rather than a skip.

amt.sh avoids the iproute2 half of this with its ip link help check
before setup. Should amt_v6.sh do the same? Should it also treat a
missing amt device type as a skip, for example by matching "Unknown
device type" or by checking that the amt module can be loaded first?

[Severity: Medium]
Does this skip in the packed-attribute case described in the comment
above and in the commit message?

If iproute2 packs the 16-byte IPv6 literal into IFLA_AMT_LOCAL_IP, the
kernel refuses it during generic netlink policy validation, before
amt_validate() runs:

drivers/net/amt.c:amt_policy[] {
    ...
	[IFLA_AMT_LOCAL_IP]	= NLA_POLICY_EXACT_LEN(sizeof(__be32)),
    ...
}

NLA_POLICY_EXACT_LEN() is an NLA_BINARY range of 4..4. A 16-byte
attribute therefore fails in nla_validate_range_unsigned(), which
returns -ERANGE with the extack "binary attribute size out of range".

That string matches none of the three patterns. As far as I can tell,
nothing in the tree emits "IPv6 address in an IPv4 attribute"; it only
appears in amt_v6.sh and amt_gw_v6.sh.

In that case, wouldn't the probe print "FAIL: cannot create an IPv6
relay" and exit with ksft_fail instead of ksft_skip?

probe_v6_gateway() in the later patch "selftests: net: add amt_gw_v6.sh
for the IPv6 netlink attributes" repeats the same pattern, so this is
still there at the end of the series.

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125191450.2497936-1-omar%40blockcast.net
Technical Details
Message-ID: <179572062428.3135.4041633001964825666@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372296-linux-kernel-netdev=dewy.ru
References: <20261125191450.2497936-12-omar@blockcast.net>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372296-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 11/12] selftests: net: add amt_v6.sh for an
 IPv6 outer transport
Date: Thu, 26 Nov 2026 19:17:04 +0000
Organization: Usenet Network
Message-ID: <179572062428.3135.4041633001964825666@kernel.org>
References: <20261125191450.2497936-12-omar@blockcast.net>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="542583"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:GJ4kM5MznQbJDQfV7JDgBzCZ/7Y= sha256:IsWwNa1SwxazvzgSyOmp9PvJt/Bs7VFXT3xLprzRpjk=
	sha1:31jBG4x1FsJ/MdKAQIGej/1FsQ4= sha256:p3HghYO/yYljnPB/OFi4ppA8kww1xG4qgG5BfspJyNE=
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 7FA47125EF6; Thu, 26 Nov 2026 22:17:40 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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] 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 LHb7lWINnL39;
	Thu, 26 Nov 2026 22:17:36 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-372296-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 00DC9125EF5; Thu, 26 Nov 2026 22:17:27 +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 33D8E37126; Thu, 26 Nov 2026 19:17:09 +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=1795720626;
	b=brqhlxJ2yLyX7mEfoPheWVnGqMQEXCCf+t4x+YL3MSiXzRMb4YakAkVvtwMDXc9PopdZ
	 D/ACqa5tGIz1ZpTx906IkLYY0/NyoWzH6D+XjbQ2fqjNT1f/pIiPuDRG2sH61CHesDSjF
	 QIzidSvabvnJAtgcZbNjreEHiAI7exHT5BJwYDLjbF9DNFE30ynTkDBPKRHa2B0txoExw
	 am9/XZd0cAECodjtoWNIQrrktbeXWS/LMXVB+iLcctlygbNFMfhgTTOC0uiVCimzMUeZT
	 c4zk1sBbi4tq5AYvMqlTQhEwJLrCm+PTwDcmKHPhWp+I2MuoCvPRYzf9RVl63OC0jtg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795720626;
	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=WDme1QdEj+83k+T3SXxy9P/XoCYbV5jh4bto230OVDk=;
	b=BhbVvFGrNPN7AhP8sTQFM0tBTnEC00DmkyXP68mogU3dcTuUdzIKy2+7TTY3yR1dK601
	 /2YRJSBaMLFtYGMiGiOu9DhkfbWY63Fy3NnoQrBhxzH7WsQBRdiNP0u4YTDfT0riP7pdu
	 Ctb3JX+ewJ2j4MrNu1Aawvb6+yyPNV/bGmQG+xCkoKxDOeEAMH7I/OrhMvb0IAFrqXKxc
	 miy63+OlT/b+TpLxdMRD0O6AN0n9XFvCmqJ6A77/U6QJyMFAopgvfbEcexB0dd/PGLlQw
	 Bxl3H/OayuPDmvw7YZyoHpvfZY35bG+palHhMxJNF7qMAqssxL9kjI+RLNwBVHyBswA==
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=WlHqVF2y;
	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 D5842606A327;
	Thu, 26 Nov 2026 19:17:06 +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=WlHqVF2y
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=1795720626;
	b=N/9ChCbi3w34zWQDzK8xCUhLPzca2lwwZnZufLJy/OXfujNoBz478pJODX0Cco0G9PuO
	 8siaKgtImufMZs1cyUOXtYRJ2RXoC+IKrAO+3a8n434Le4wyDAykLi1bE2QTHjUK50XFj
	 nT2Iwcw08EcPUg5kZ3ow8i/A63aEys0l9+n74rLKdX1URweR0wQIZPM1/0syeURmD/15x
	 kz350LCY++MSJOLAfK7muvaFaDFq01MSLznxaPQdRUTCspoGWPmveJryrOL/IS5SFBHb8
	 HDNnefSx1hSpqbCc8dl1gxayUcgjF0edz5lUfgKSWfBkJ0feLZ1H3vqTV/CJ24mVLeQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795720626;
	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=WDme1QdEj+83k+T3SXxy9P/XoCYbV5jh4bto230OVDk=;
	b=HKjjgi2JIh0Z4xByiJ3B7vrc77oqwpvegseV+bYnKb4EHwxFqtBfj4LkUVNkQ5ha48Qj
	 daQSG/l/Q+Yig6Y24vk+u13ClG09LU0SBjMcFVZ8QvG0YNp4fcKMes2R+WjE1mGixBjIk
	 vZ7kX4inPUsXtnAaBhemQZRz+v+1wMy8iNFH1vnmVZvDkA68b7f+UDNgj2E+5g89YR46s
	 v4wOdEe5mk/igXez2JaxrKRtL7Hp20f0qiQ531w9lJT+xTwj0AEQ30Y6L0lZHrTIc+tLE
	 Qv2YosykOjn/VwJdrpck2w0KzeBpFCzKQ1RwNJmNh6M7uY6kZNWgInqJkmXkZ9qLeVg==
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=WlHqVF2y;
	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 00DBB606A329;
	Thu, 26 Nov 2026 19:17:05 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAD1E1F00A01;
	Thu, 26 Nov 2026 19:17:04 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795720625;
	bh=WDme1QdEj+83k+T3SXxy9P/XoCYbV5jh4bto230OVDk=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=WlHqVF2yhvtPTr9dSYS6xrAT0F9d/ys7MCvMpQyPvouv++yGgiierKoKer1xnKITR
	 AjiIzsw5UeP5GQ4D70OOSC8atxpU5fKECOQgLkBIfiIF3SWHOie6I//tAWhR3QjG5w
	 Bp+diahQZe/ujbGEshiCFuBEmdER5bvvalRym1UNSxktHKumRmdvazN6v4XulOH5/I
	 rkIIEAcjPesiG0CvzogCDTS28kPbKkxNyG4bpvxdQin7CFXXS1lm1r9N4F7UHIGC6e
	 1v7KdMVM7jy+am4JUCMVPadYOebZKWzzJNMi0/fwhw219Pj8lRh9lubFaO6hx+vKDl
	 6758WpYqnELjw==
X-Cc: ap420073@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org,
 horms@kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
 linux-kernel@vger.kernel.org
X-In-Reply-To: <20261125191450.2497936-12-omar@blockcast.net>
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