From: netdev-bot+sashiko@kernel.org
To: omar@blockcast.net
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
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 [thread overview]
Message-ID: <179610758587.3146.15824857978778400410@kernel.org> (raw)
In-Reply-To: <20261130064249.1874523-13-omar@blockcast.net>
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
next prev parent reply other threads:[~2026-12-01 6:46 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 6:42 [PATCH net-next v5 00/12] amt: add an IPv6 outer transport Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 01/12] amt: create an AF_INET6 encapsulation socket for an IPv6 outer address Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 02/12] amt: send the Relay Advertisement over IPv6 Omar Ramadan
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 6:42 ` [PATCH net-next v5 03/12] amt: key relay tunnels on a union amt_addr endpoint Omar Ramadan
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 6:42 ` [PATCH net-next v5 04/12] amt: send the Membership Query over IPv6 Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 05/12] amt: forward multicast data " Omar Ramadan
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 6:42 ` [PATCH net-next v5 06/12] amt: size the encapsulation headroom by the outer IP version Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 07/12] amt: send the AMT gateway control plane over IPv6 Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 08/12] amt: receive " Omar Ramadan
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 6:42 ` [PATCH net-next v5 09/12] amt: add netlink attributes for an IPv6 outer transport Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 10/12] MAINTAINERS: amt: cover the amt headers and selftests Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 11/12] selftests: net: add amt_v6.sh for an IPv6 outer transport Omar Ramadan
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 6:42 ` [PATCH net-next v5 12/12] selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes Omar Ramadan
2026-12-01 6:46 ` netdev-bot+sashiko [this message]
2026-11-30 17:27 ` [PATCH net-next v5 00/12] amt: add an IPv6 outer transport Matthieu Baerts
2026-12-01 8:48 ` Matthieu Baerts
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=179610758587.3146.15824857978778400410@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=ap420073@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=omar@blockcast.net \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=willemb@google.com \
/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
all inboxes | Powered by JetHome®