Article View: linux.kernel.netdev
Article #23835Re: [PATCH net-next v3 12/12] selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes
From: netdev-bot+sashiko
Date: Sat, 28 Nov 2026 09:48
Date: Sat, 28 Nov 2026 09:48
129 lines
12726 bytes
12726 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 tools/testing/selftests/net/amt_gw_v6.sh,
probe_v6_gateway() exits the whole script with $ksft_skip whenever the…
- [Low] The new selftest tools/testing/selftests/net/amt_gw_v6.sh gives a
reason for adding the IPv6 address with `nodad` (line 158: "# nodad: a…
--
selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes
This adds a netlink-only selftest for the AMT IPv6 attributes
IFLA_AMT_LOCAL_IP6 and IFLA_AMT_DISCOVERY_IP6. It checks that gateway and
relay addresses read back through amt_fill_info(), and that invalid
combinations are rejected with the expected extack message. A probe skips
the test when iproute2 or the kernel lacks IPv6 AMT support.
> diff --git a/tools/testing/selftests/net/amt_gw_v6.sh b/tools/testing/selftests/net/amt_gw_v6.sh
> new file mode 100755
> index 0000000000000..38858cbc9d3b8
> --- /dev/null
> +++ b/tools/testing/selftests/net/amt_gw_v6.sh
> @@ -0,0 +1,210 @@
[ ... ]
> +probe_v6_gateway()
> +{
[ ... ]
> + if ! add_amt amtprobe mode gateway local "$V6_LOCAL" \
> + discovery "$V6_DISC"; then
> + case "$ADD_ERR" in
> + *"binary attribute size out of range"*)
[ ... ]
> + fi
> + got=$(amt_field amtprobe discovery)
> + ip -n "$GW" link del amtprobe
> + if [[ "$got" != *:* ]]; then
> + # The attributes are exactly four bytes, so this is an iproute2
> + # that truncated the literal to an IPv4 address, or prints the
> + # IPv6 one under another key. Four truncated bytes cannot be
> + # told from a real IPv4 address, and the kernel did what it
> + # should.
> + echo "SKIP: iproute2 lacks IPv6 AMT support (read back '$got')"
> + exit "$ksft_skip"
> + fi
> +}
[Severity: Medium]
Could this check report a regression in amt_fill_info() as a skip?
With this series, amt_policy uses NLA_POLICY_EXACT_LEN(sizeof(__be32)) for
IFLA_AMT_LOCAL_IP and IFLA_AMT_DISCOVERY_IP. The "binary attribute size out
of range" branch above already catches a 16-byte value in an IPv4
attribute. So if add_amt succeeds here, the kernel has received
IFLA_AMT_DISCOVERY_IP6 and built an IPv6 gateway.
Suppose amt_fill_addr6() stopped emitting this attribute, or emitted the
IPv4 IFLA_AMT_DISCOVERY_IP in its place:
drivers/net/amt.c:amt_fill_addr6() {
...
if (amt->mode == AMT_MODE_GATEWAY &&
nla_put_in6_addr(skb, IFLA_AMT_DISCOVERY_IP6, &amt->discovery_ipv6))
return -EMSGSIZE;
...
}
Then got would be '' or '0.0.0.0', and the whole script would exit with
$ksft_skip before test_v6_gateway_roundtrip() runs. That function's check:
[ "$(amt_field amtg6 discovery)" = "$V6_DISC" ]
check_err $? "discovery did not read back as $V6_DISC"
can therefore never fail because the readback is missing or IPv4. The
commit message says the test checks that the IPv6 discovery address reads
back through amt_fill_info(), and this check does not fully cover that.
The skip is meant for an older kernel that truncates the address, where
2001:db8:a::2 reads back as 32.1.13.184. Could it match that value instead
of any readback without a colon?
[ ... ]
> +trap cleanup_all_ns EXIT
> +setup_ns GW || exit "$ksft_skip"
> +ip -n "$GW" link add gw_dev type dummy
> +ip -n "$GW" link set gw_dev up
> +ip -n "$GW" addr add "$V4_LOCAL/24" dev gw_dev
> +# nodad: a tentative source address would race link creation.
> +ip -n "$GW" addr add "$V6_LOCAL/64" dev gw_dev nodad
[Severity: Low]
Is the reason in this comment accurate?
amt_newlink() checks only the syntax of IFLA_AMT_LOCAL_IP6. It rejects
loopback, any, multicast and v4-mapped values. It never checks whether the
address is assigned to an interface or still tentative.
The encapsulation socket is created only by
amt_dev_open()->amt_socket_create()->amt_create_sock(), and for IPv6 it
binds to :: in any case. This script never brings an amt device up. So
there seems to be no race between DAD and link creation for nodad to avoid.
Separately, the "Not covered" list in the header comment at the top of the
file names only the two duplicate-argument cases: discovery v4 together
with discovery v6, and local v4 together with local v6. The commit message
lists a third case, a 16-byte IFLA_AMT_LOCAL_IP or IFLA_AMT_DISCOVERY_IP.
Should the header comment list that case as well?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261127094703.3025517-1-omar%40blockcast.net
Technical Details
Message-ID:
<179585932383.3135.977907655234165301@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373083-linux-kernel-netdev=dewy.ruReferences:
<20261127094703.3025517-13-omar@blockcast.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373083-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v3 12/12] selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes Date: Sat, 28 Nov 2026 09:48:43 +0000 Organization: Usenet Network Message-ID: <179585932383.3135.977907655234165301@kernel.org> References: <20261127094703.3025517-13-omar@blockcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="925096"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:s6Gf9+V2CL2yGPzqS3mG9xt3Ifo= sha256:/JON7REazMbrumahZRhz42S+4d195a+52sUx3resCgo= sha1:jGmowXKG3zQw7bPTtcrV6S5djTM= sha256:g8ia2nLIOik847PjPHbtafyOrLzxoxmjP/i0VgkL7ss= 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 E6C43125F76; Sat, 28 Nov 2026 12:49:22 +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 DBWadHJkVzAp; Sat, 28 Nov 2026 12:49:19 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373083-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 0A157125F6D; Sat, 28 Nov 2026 12:49:11 +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 3FB442A702; Sat, 28 Nov 2026 09:48:54 +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=1795859326; b=sVYzsJt3fd/RhFuyW6Yj1AQBi2HN2U6aIrOSZ7pguDYTZj6eQCJwKDpTAdlc6SkCatQg xpoM5MtaWRtkJU0Cv8p1ggihtTTeyeWSDm/5M+Z/50FZ6uHOhTCZQETOjSIxVLioZbW/s WLs0o18LNRft/xsUmWF8YzSXSWn6w38fdT6bneEwzIDXluW/Vo1AW4Fvr+mBYynzUq53v CPPgvOGSzRf6PP3nxYlbVjiXt1Il7Fh8pBzQWVd5N4IoTmKYUDD9fZznCG3QTFUe48wyB t48j+A0UManoPPWHgvVETAu/iGUpxlnOrI9O17ZEMHmCWgu+TnF3eq2qEhV+uhTRdxw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795859326; 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=AXbs4Y08RfwAdusG9LPgruxTER1AdJ9w1oDDyOdB+wY=; b=rOqSi3kp/dCU7hb1Nvlil15HSp6OZMfmlWyoMmQuLO+z7uUk/fgAyo9jytJ+ORpLOy/T pX8fXQCJ25ePjUTx3kNET78jta4JnHpCvRWqPJkBv4JDp0yuiZQZ4V/y4WYXqxg3yNvKT wC25KIZxjDEul5wttIKq7jItn4UatAYSCKdO9gQA9Nb+IwYGmQb66dvYs8ZzZLfFj7o2R cuZL/2EOA4eMjX7ZZoWlM679Kruho5Tc4ly8hScId5T+DTgZMpunYka/0/7+LGUjwkrGt 4rQKVgiX4qKNH+O8rZVMgHiMOmEYnehCAlU08gK/wG/FuMfhIGr9phO7i1Gc3/e4+9g== 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=EjK+TqbK; 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 0D772606A32F; Sat, 28 Nov 2026 09:48:46 +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=EjK+TqbK 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=1795859325; b=hPsRLj5o9p2lAXj09c1Hu/E7pNWM4qTc8pqe4G4cuPYvCjXkRhbCehwB81qZnC4n6CDH pW8IeRdmcXRfSprA6CU8RHy8TK7GpG4twgUwpOFFjJbU5CVlummzFHADVkVSatCkoGdKw 8zIydrYksfDv5t19IjverroHCueWtbB4I/CLsPnO5Za3USrCDwbU6neWX81wpJi46nWe6 zn4diAImv8Fgdja6nOmGNS5BSB+Qs17PwJzfQzCNZ9FhgO+f/Zw4rS3HEjpGrfEx2T76o oAGiG/+7WJ88In3d6n1ZC8OKfrLLmlgmXDJNC51IgfoRS11ywoO2Wva8ITy9v9lYnSQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795859325; 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=AXbs4Y08RfwAdusG9LPgruxTER1AdJ9w1oDDyOdB+wY=; b=NIvMAAGIZ/f3ZpDpGbO5J3C1Yz74e1wymsOLnZeXUZ3/CGivdyfMw4ysTsaTaJBSe4UF LeC4X5YYf+rMoejU17yaj1mMal0tDxv0DNvndUSCCc3ORyIOjUfJALKOCHNaFEGpBB4XQ 9lQbOL+YQDQ9ZmFOvRtsOioENHYG9uS7c4aH6WO2hstONupHPKMOwq4oGX6be7CiLv4P6 pRpJ3Unt5jUV4MZjtwyeoi1oKiJiSDhoA5F+M4nQHCcM3SB8UV1q5Wk8caGhAxKSyz3dc 5fSOVjyXpeuWRl+oUwGR3QW3PU5cQLO+02nrnNC4T5JpX7qm2FDa3C47K7Evjurxk8g== 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=EjK+TqbK; 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 30414606A68F; Sat, 28 Nov 2026 09:48:45 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 473B91F00931; Sat, 28 Nov 2026 09:48:44 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795859325; bh=AXbs4Y08RfwAdusG9LPgruxTER1AdJ9w1oDDyOdB+wY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=EjK+TqbKBdErilQiW5SmS7G9BzOd3iZmeaxs453dYf/bMoFwykR/gjilX0eBPNP0v /nDeuzYXulGwZE/NQQASHoCLDFKjcgDdI1pDtkKDGj911SLL+89A/JFio2I2ZMfPh5 7r1Y51nFV0ABdA8afZTL4tAMCdf1KnKSTbMcufFsspwNuyu3VbYtXEPtwCkEJcvg/L IQELL9KLxxSgHUTrxmgHysrOWrK/OFZ43f2EkF1bKoC/4idI00VpvwQlpKDLoxO8o0 q8CD1YVCbc63beeqXsY7lUXSHsYPLNNSQ0sBiGI0ptgzcUGYBQ59x9mWXMSUS9la1t 2xeiqO/o5ZIzg== 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, willemb@google.com X-In-Reply-To: <20261127094703.3025517-13-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