From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796107585; b=zWvId8v2ikB8XCrMXYnY2skDwaVERemsU602v9NaF0gG/c1fZoAQOAqCftK/jEMuUjTK WiQfag+yRYA5GO2HMfRM+8reTYRBN0A4TxZb7h+UzslZqO/RHyiyR24El4bObSbFlEZ7a tTL2/cTLuCUt5MGAnqj81o8D5RqwV3VZaQOb4XlCCK2ZxtC0KrcMGgmEomugw/8qWKSPs f4vf0A2a1dhk2LAM0w9n2WBFPySROXBzTkFkm02pp53MksEzqyV5TiYLduGTMzYN68YDd W1uYKd3mHXfPO4U3GzDakSApNurJ7k6cwepjrUnsjksekkvSvMxiJdEHUcImzKXgQpA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107585; 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=CODcADl0U6Av0ZfaLM+Jw0yTB2O7KgfzizrbSd9zM5U=; b=s/BHQMBbgyqxaSNtKVO0NGy9T41M/eSpBXHQ3s1Yz/UuUaBEUKS8ggnDVyRTKyc83TP1 ac13g51seO42uO7E25jMwoHNTMXpHh6AjKgwNmnRRB5Arm2Kj6FjMAlk8bKWojJ53FjfV g77Jl5+eXmkjJ5eGjaHBasf+wtEtUsgRbqsJjYRQpggcHphntD7Kgxw5+Ry+h7WqXHHg2 wAXj73Q6Df9TsvCSM2PCHBZ8Xkn1KMaxmA3NJjY7HbnTj98YeYQGtfMJzZHx6vBLCTd3X sPs7/NHzDiT7cGqCCtohh9NOJYeocBz6BtX/ePdOK6+DU/gWeDj1Mj8D7BMWYtLDAQw== 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=MUFQZPQI; arc=none smtp.remote-ip=100.103.45.18 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 57CA2606A688; Tue, 1 Dec 2026 06:46:25 +0000 (UTC) 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=MUFQZPQI Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66C441F00930; Tue, 1 Dec 2026 06:46:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796107585; bh=CODcADl0U6Av0ZfaLM+Jw0yTB2O7KgfzizrbSd9zM5U=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=MUFQZPQII8VMywhVF+Tqw76EgQz1ez9OWJ1qEu0gR0TcK+n/Ju++RK2p1kAhmaZfc a+kW7vaG9Vr1AEsW+Mn78f6cs14En/NaITqD+PWR8nGSda9QytSBkxKuicC73gNFPk osyHdKRy/L8wai4XOC+uJOXE+8ZWEZyvVB3uhq5dCN0ug21zVa8/QiRvaT9XDf31mg TjdeDFthYe7vUvA4b+v509uKitruw9qcAcZYm9/ksRtWvFJP82aJoMBWVakTpR/o1A bPctY/LfyIcWMlMNRNFux/zQNJ0xAKC+/s5GxPZdu5x7OW1io/mZ16R7jFpXKZiGKN lNPWhvXeKZxAQ== Subject: Re: [PATCH net-next v5 11/12] selftests: net: add amt_v6.sh for an IPv6 outer transport 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 Date: Tue, 01 Dec 2026 06:46:23 +0000 Message-ID: <179610758393.3146.1477119977377490689@kernel.org> In-Reply-To: <20261130064249.1874523-12-omar@blockcast.net> References: <20261130064249.1874523-12-omar@blockcast.net> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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] In tools/testing/selftests/net/amt_v6.sh, test_local_source() takes `[ $((d1 - d0)) -ge 3 ]` (line 504) on amtr's rx_dropped as… - [Medium] In disc_answer() (line 371) and local_src_answers() (line 443), the tcpdump capture runs under `timeout 6`, which starts… - [Low] In amt_v6.sh, the main body runs `set -E` and `trap 'setup_fail $LINENO' ERR` (lines 541-542, 546) around setup_topology(). -- selftests: net: add amt_v6.sh for an IPv6 outer transport This adds amt_v6.sh, a variant of amt.sh that moves the AMT gateway<->relay link to IPv6 and adds more gateways on that link to exercise the per-/64 tunnel cap. It also checks Packet Too Big handling, that Discoveries sent to ff02::1 or from the relay's own address get no answer, and that the gateway rediscovers the relay after down/up. > diff --git a/tools/testing/selftests/net/amt_v6.sh b/tools/testing/selftests/net/amt_v6.sh > new file mode 100755 > index 0000000000000..8e080d60d5a46 > --- /dev/null > +++ b/tools/testing/selftests/net/amt_v6.sh > @@ -0,0 +1,564 @@ [ ... ] > + SMCDIR=$(mktemp -d) > + ip netns exec "$RELAY" smcrouted -P "$SMCDIR/pid" -u "$SMCDIR/sock" > + slowwait 5 test -S "$SMCDIR/sock" [Severity: Low] Can this print false setup failures on a run that passes? The main body runs setup_topology() with errtrace on and the ERR trap set: set -E trap 'setup_fail $LINENO' ERR With set -E, command substitutions inherit the ERR trap. slowwait goes through loopy_wait() in lib.sh, which runs the probe like this: if out=$("$@"); then The if only suppresses the trap for the assignment in the parent shell. Inside the $(...) subshell, a failing test -S is an ordinary command, so the inherited trap fires. setup_fail then prints "FAIL: setup failed at line N" to stderr and exits only that subshell. smcrouted creates its socket after it daemonizes, so the first polls usually fail. Each failed poll prints a false FAIL line, even though setup succeeds and the exit status does not change. Could this wait run outside the ERR trap, or without set -E? > + ip netns exec "$RELAY" smcroutectl -u "$SMCDIR/sock" \ > + a relay_src 172.17.0.2 239.0.0.1 amtr [ ... ] > +disc_answer() > +{ > + local dst=$1 filter=$2 pid i rc cap > + local to="UDP6-SENDTO:[$dst]:2268,sourceport=40000" > + > + cap=$(mktemp) > + ip netns exec "$GATEWAY" timeout 6 \ > + tcpdump -nni gw_relay -c 1 "$filter" > /dev/null 2> "$cap" & > + pid=$! > + # The capture is ready once tcpdump says it is listening. If it does > + # not, whether it is gone or still starting, nothing it reports means > + # anything. > + for i in $(seq 50); do > + grep -q "listening on" "$cap" && break > + kill -0 "$pid" 2> /dev/null || break > + sleep 0.1 > + done > + if ! grep -q "listening on" "$cap"; then [ ... ] > + wait "$pid" > + case $? in > + 0) return "${rc:-0}" ;; > + 124) return "${rc:-1}" ;; > + *) return 2 ;; > + esac > +} [Severity: Medium] Does the capture always last long enough to cover the sends? The timeout 6 clock starts when tcpdump is launched. The readiness loop can take 5 s or more of wall time by itself: 50 iterations, each forking grep and sleep 0.1. The three sends with 0.5 s sleeps come after that. The readiness check only greps a file. It still passes if timeout has already killed tcpdump. In that case the Discoveries go out after the capture has ended, wait returns 124, and disc_answer() returns 1. test_mcast_discovery() then treats that as the expected result for ff02::1: disc_answer ff02::1 "udp and src port 2268 and dst port 40000" [ $? -eq 1 ] The commit message says: The ff02::1 check accepts only "no reply", so a broken capture cannot pass it. Is that still true when tcpdump reports listening late? The unicast positive control runs in a separate, earlier tcpdump instance, so it says nothing about this capture's window. local_src_answers() has the same overlap with its own timeout 6. If tcpdump is gone before the sends, this gives 0 with status 0: ANSWERS=$(grep -c "UDP" "$cap") The "not answered" check in test_local_source() then passes without having observed anything. The same timing would also make the positive checks fail spuriously. Could the deadline start once tcpdump reports listening, or could the capture be stopped explicitly after the sends? [ ... ] > +# A Discovery that comes in from the wire with one of the relay's own > +# addresses as its source is not answered: the Advertisement would go to this > +# host over lo, where a rule such as "-i lo -j ACCEPT" lets it in. IPv4 input > +# refuses such a source as a martian; IPv6 input does not. SPOOF holds the > +# address on its lo only, so nothing on the link announces it, and sends from > +# it out of its own veth. The relay counts each drop in rx_dropped, which shows > +# that the Discovery got there. The same address over lo is a gateway on the > +# relay's own host, which IPv4 accepts too, and is answered. > +test_local_source() > +{ [ ... ] > + d0=$(rx_dropped) > + local_src_answers "$SPOOF" ",so-bindtodevice=spoof_relay" > + check_err $? "the capture on lo did not start, or a send failed" > + d1=$(rx_dropped) > + [ "$ANSWERS" -eq 0 ] > + check_err $? "the relay answered its own address, $ANSWERS times" > + [ $((d1 - d0)) -ge 3 ] > + check_err $? "the relay dropped $((d1 - d0)) of the 3 Discoveries" [Severity: Medium] Does the rx_dropped delta really show that the spoofed Discoveries reached the relay? amtr's rx_dropped also counts other drops, and test_source_cap() leaves one of them running. It creates amtg4 when 2001:db8:a::/64 is already at its per-source cap, and nothing deletes it: ip -n "$GATEWAY2" link add amtg4 type amt mode gateway \ local "$GW4_6" discovery "$DISC6" dev gw4_relay \ gateway_port 2268 relay_port 2268 amtg4 keeps running amt_event_send_request(). Each cycle sends an IGMP Request and an MLD Request, with a 2/4/8/16 s backoff. It then rediscovers the relay and starts over. On the relay, amt_request_handler() rejects each of these Requests: if (!have && (full || per_src >= amt_max_tunnels_per_src(amt))) return true; amt_rcv() then increments amt->dev->stats.rx_dropped, the same counter that rx_dropped() reads. The d0/d1 window here lasts a few seconds, so one or two amtg4 cycles can add 2 or 4 drops. Suppose the SPOOF Discoveries never reach the relay, for example because the SPOOF veth or bridge setup is broken. Couldn't the delta still reach 3? ANSWERS would stay 0, and the check would pass without testing anything. Would it help to delete amtg4 at the end of test_source_cap(), or to check something specific to this drop? -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130064249.1874523-1-omar%40blockcast.net