Article View: linux.kernel.netdev
Article #25018Re: [PATCH net-next v5 12/12] selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 06:46
Date: Tue, 01 Dec 2026 06:46
177 lines
13725 bytes
13725 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] Four rejection cases in amt_gw_v6.sh only test the kernel rule
they are named after if iproute2 sends an unspecified or multicast…
- [Low] probe_v6_gateway() in amt_gw_v6.sh also skips on any probe-
creation error containing "Operation not supported" (line 70).
--
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 IPv6 and
IPv4 gateways and relays read back correctly through amt_fill_info(). It
also checks that each new link-creation rule rejects bad input with the
expected extack message, and 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..f44e95051b74f
> --- /dev/null
> +++ b/tools/testing/selftests/net/amt_gw_v6.sh
> @@ -0,0 +1,221 @@
[ ... ]
> + if ! add_amt amtprobe mode gateway local "$V6_LOCAL" \
> + discovery "$V6_DISC"; then
> + case "$ADD_ERR" in
[ ... ]
> + *"Local attribute is required"*|*"expected rather than"*|\
> + *"IPv6 support is disabled"*|*"Unknown device type"*|\
> + *"Operation not supported"*)
> + echo "SKIP: no IPv6 AMT support: $ADD_ERR"
> + exit "$ksft_skip"
> + ;;
> + esac
> + echo "FAIL: cannot create an IPv6 gateway: $ADD_ERR"
> + exit "$ksft_fail"
[Severity: Low]
Is the "Operation not supported" pattern in probe_v6_gateway() intended?
The commit message lists the probe's skip conditions one by one and then
says:
"Any other failure to create the probe link is a FAIL."
"Operation not supported" is not in that list.
When amt is missing, __rtnl_newlink() already sets an extack, and the
script matches that message separately:
net/core/rtnetlink.c:__rtnl_newlink() {
...
if (!ops) {
NL_SET_ERR_MSG(extack, "Unknown device type");
return -EOPNOTSUPP;
}
...
}
With an iproute2 that supports extended ACK, the strerror match mostly
catches an EOPNOTSUPP that has no extack message. One example is a netdev
notifier failing during register_netdevice() or netdev_upper_dev_link()
in amt_newlink().
This is unlikely on a dummy device in a fresh netns. Still, wouldn't such
a create failure become a SKIP instead of a FAIL? You could either drop
the pattern or list it in the commit message.
[ ... ]
> +expect_reject()
> +{
> + local desc=$1 want=$2; shift 2
> +
> + RET=0
> + add_amt amtbad "$@"
> + check_fail $? "link was created but should have been rejected"
> + ip -n "$GW" link del amtbad 2>/dev/null
> + grep -qi -- "$want" <<< "$ADD_ERR"
> + check_err $? "rejected for the wrong reason: $ADD_ERR"
> + log_test "$desc"
> +}
[ ... ]
> +expect_reject "unspecified v6 local is rejected" \
> + "Invalid Local IPv6" \
> + mode relay local ::
[ ... ]
> +expect_reject "multicast v6 local is rejected" \
> + "Invalid Local IPv6" \
> + mode relay local ff02::1
> +expect_reject "multicast v6 discovery is rejected" \
> + "must be unicast" \
> + mode gateway local "$V6_LOCAL" discovery ff02::1
[ ... ]
> +expect_reject "unspecified v6 discovery is rejected" \
> + "must be unicast" \
> + mode gateway local "$V6_LOCAL" discovery ::
[Severity: Medium]
Do these four cases only work if iproute2 passes :: or a multicast
address to the kernel unchanged?
expect_reject() passes only if ADD_ERR contains the kernel's extack text.
amt_newlink() is the only source of "Invalid Local IPv6 address" and
"discovery must be unicast". It emits them only when IFLA_AMT_LOCAL_IP6
or IFLA_AMT_DISCOVERY_IP6 actually reaches the kernel.
The existing iproute2 amt parser follows the vxlan pattern and filters
these addresses itself:
- It rejects multicast addresses through is_addrtype_inet_not_multi(),
with invarg("invalid local address") or
invarg("invalid discovery address").
- It adds the attribute only when is_addrtype_inet_not_unspec() holds,
so :: is quietly left out.
Suppose the IPv6-capable iproute2 keeps that filtering. Then:
local ff02::1, discovery ff02::1
fail with iproute2's own message
local ::
the attribute is left out and amt_validate() reports:
drivers/net/amt.c:amt_validate() {
...
if (!data[IFLA_AMT_LOCAL_IP] && !data[IFLA_AMT_LOCAL_IP6]) {
NL_SET_ERR_MSG_MOD(extack, "Local attribute is required");
...
}
discovery ::
amt_validate() reports "Discovery attribute of the local family is
required"
None of these messages match the grep in expect_reject(). Each case
would report "rejected for the wrong reason" and fail on a correct
kernel. The kernel's unspecified and multicast checks would never run.
The IPv6 iproute2 changes are not in this tree, so I could not confirm
whether they keep the filtering.
The commit message says the test checks:
"an unspecified, loopback, multicast or IPv4-mapped IPv6 local or
discovery address."
It names only three cases that iproute2 "cannot express". Could the
commit message or the script say which iproute2 behaviour these cases
need? Another option is to skip them when the error comes from iproute2
or from the missing-attribute path.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130064249.1874523-1-omar%40blockcast.net
Technical Details
Message-ID:
<179610758587.3146.15824857978778400410@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-374760-linux-kernel-netdev=dewy.ruReferences:
<20261130064249.1874523-13-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-374760-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v5 12/12] selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes Date: Tue, 01 Dec 2026 06:46:25 +0000 Organization: Usenet Network Message-ID: <179610758587.3146.15824857978778400410@kernel.org> References: <20261130064249.1874523-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="1639883"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:tcVqt909HufHJa3xtL8nGO7swBE= sha256:AsT2rS03aiBVSLJJTxeE/orU5hamQLm0gamHGxS9GTc= sha1:hldf+aDsOoCD/p8utI99VVdY9Og= sha256:GXuuT1Ez0KFESwVGL2FkUiXpTn4tCKXU7Q6ay7GKNvI= 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 07ED511727B; Tue, 1 Dec 2026 09:47:35 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 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, 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 lLqjxAUwXXhK; Tue, 1 Dec 2026 09:47:31 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374760-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 640DD117276; Tue, 1 Dec 2026 09:47:23 +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 5D99D2FF46; Tue, 1 Dec 2026 06:46:39 +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=1796107588; b=PdFn4+9IguVsN2ugtTTXJvulSK9//LrhEOS+5IKFEXa7YY6jJQvRgD2WSMA+QwnnIIhr pLoikIZaAH4o9yiBVzDOtgE39U7rIatFNADhvqOz/8GBT88RqheGapRi/9jykLZS68BqR K8UCOx59eM8aUy9tvqi4dznLz3C2acFKmRLnnlX2KopXwYPxPBLen5yTgNnbmMXPzQ64o Dgl3MueLaBcewzEynShWtLAvV4bWhYg+RthHqCChFddoz6NfeUCnfvdPm0nCJTnJCyPJ9 l7cpnlmpBzaKEjZqYbFBI+Ca4LaM7zhl0ibcjjKQrjGJx/yU4c496C/IxDQCBFkDqVg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107588; 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=JRW/hi6pFxgu4cGwEU4hlIi2CVmr9JlGubzQMoZ1WcI=; b=clm/e+tULTL1liIcS5yE5EE1zxdytgHps6EqEXe/d/vVuoyvkpmYFaDOgEjN9Wi6yy1n 0Zlw4KfxWq6JpluAve333jXJjAbIH+UqQEqnMTogWzY8vbCbGN1F/xrUgeYqLuE0LuzHF ZVyx8wPrDo9ttSOpxuxAo2DaOKef/xpMn+Q38feS4RHr70fMsyQO5tPF8pz4voj42W4+n SBmrPALR9AMRrgfi4HvE4dBCPHbZPEFrb9Z5Quh6vcN0YiTX3lfhI88slw0+WQsjnfAzD 1ykyKQKjYb9Ee+QAFd0yTOBYtYyuzHeBXbIhXimGH1WHhVayakFm3eZeHc2Xud4ZCUQ== 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=GFt21PIp; 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 6937160A2604; Tue, 1 Dec 2026 06:46:28 +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=GFt21PIp 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=1796107587; b=lkx/Mcc7EzYtXKLRCcNRlcE8T3lS4R2E6Nux+VPulxRoVouZAfAyT4KnJqaixjLr7Sl+ tpAXPtdF2LY2YNU6U0rGfYeRjtqqL5Km927N1Wpjse19hdYm+Y0+NjrfTdZNeZ6eutL2l X8coBLHnJh8Z5LqyfQbJ3bz40cJwulHHR12VivNjRbDbRlqyp9R2otAmO/aFOofkY+u4a 60wB3dBZkRCKooZfq9o4qXyLXiNh92JNZuaMcQ8Jq/Bw2i8sxRfoem8YPfHRXJgABvDf3 LDp/crOmUvDobvFI1GAY3oKs4rl2aDxY7W6HT+6Z4R/wE7YdkkFuWZeqvw10gh/wRcw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107587; 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=JRW/hi6pFxgu4cGwEU4hlIi2CVmr9JlGubzQMoZ1WcI=; b=pBagmhR51VCG74pMgCm2TV+iqJ72EiPrVjIYo/Xaf0qUcDF4PUzymvaYPC5rewwl3/jP QAibfy21MNQLVNKUuPEAVf8E6gNrNQEIEk7Co6H/rjA5ObIRHBpkfGMb/6pPe173TAWfB giUhPckWXc/WLfWbMJ548Sbz9roEQ0x3jLqY4DKDzf1zSE4iR+4V3XlRvDOcInEpcPQeP +CJyJGNnsc1NS1wgITHpe91MpTXu9L+uqBTadb27DVeaowsZfr66vBTnXksAjGEYRUK71 1mpzK94RE87WjuT3ByYzvJqXPm6vShmEaQ34RWR0JRva+MpoOVcm9/UW3Tb86DGrjPQ== 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=GFt21PIp; 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 8A8BA606A69D; Tue, 1 Dec 2026 06:46:27 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E3241F00A21; Tue, 1 Dec 2026 06:46:26 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796107587; bh=JRW/hi6pFxgu4cGwEU4hlIi2CVmr9JlGubzQMoZ1WcI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=GFt21PIpUsSr39AB0LS67f3ztGvdb9tRex5b2fv6ZlK/aWhdER3wNm+9DxnpCO0/P SmXdCDXkEwBxL1gq8sahMiSGYAcVFFpUtSjFCaVkfmpX7XY3Gid93BLtz8xB+sbARn 30wVmHNqLc3bTyrgZHZxrNt54FkL8ygmfIwu5T39QbARFVFPGPRKf5J7KU/kkwmhCP 4H3HGN6oGAp5vQTwftPdITPo0pvbZmevh4Sf1CzwHbxYoBYaqCTx5Qs0X4qyXCo9Vo i+jZVqqU99cym5YpmA0XyKxpxIF0S3SAKw8qT7+YLo87Ba7jGSRWR2ofl0o/nM8oWY nCK2avsnh5m5g== 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: <20261130064249.1874523-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