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=1796010516; b=Eyg87WQCndByY/41ayYFxkh/ZNoSpKL2NMeVuUnDaCtru2cYRV3SIMlsAt9vQrncsgir ULBK8y+ryB0jC4NSjg66ckxJLOq8/1vTr38EcmrbTF2nB7aBqag5MdN1YHR8z4oU1yr2e LBmrf4UA01vl/HiVN/1dN0jkIHIYA9KcbcgR5NKqg1HOWndsfiCeUnpx6nZ/sJ9Lslav8 vrmBRjCEduJhU6Y2hMK9UXsmmR4OOM+cOVG3YDC5CCw3yBKI8MDORX2ezbAP9eaPxB4XD 3Itn6j9K/v8zGfsntSKQ0f3vbZCIyKE9k9lqBRTOB/sHjG0yomOhjRGKJ7E9FmQV8Zg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796010516; 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=kx82iYKKTZFQEuIMjvpcGnQuxPmoG218HOThHCI6q4Q=; b=peHZeXXN9JdVfYxXMduzmf5P27du45o3j4bgsG7gpSNqFDIMlIacmdFh9yapIdAQ4sy5 726GI19+gnBgT3mH2dmMainPsPwxDdcLebA6I9+UXFsyrkNfnnU9IvoiKM7Kz2ODwQO7j 6JproY2xeN30vZpQWFlrtjNg+z8HisrMGxzAZworRsVRy9Pw/wax4NhguFOo92VkzF7FD Mir53kvS5g59kGHEtg9ML51hfOzHN3mzgz1QABGL0s6eeU+DsudB1ivTy84pIaz9IPN9M Uq0V4UeQPIRbiUDO/IbwB79Q6IxYA2oMA8nICXkixMVmfpo1wdsjwwgltCLPjg+WrmA== 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=HXJFQvpb; 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 83A3B606A329; Mon, 30 Nov 2026 03:48:36 +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=HXJFQvpb Received: by smtp.kernel.org (Postfix) with ESMTPSA id E96381F00936; Mon, 30 Nov 2026 03:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796010515; bh=kx82iYKKTZFQEuIMjvpcGnQuxPmoG218HOThHCI6q4Q=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=HXJFQvpbwVWBcc0aJ/4Zo4cDdWuKDhHfWrRsw8Mc9EMHOLBlqE4ERdEOd1xUBRpE6 teUjTDH+95xeo83X4J/+syIT3mCUbiD5DcRSUvChEna6kkuEqB1qrDi/MyQ1iutMAc 0wsiXGFM0VcHeFI3TySdxs0PBIFO8oN8YT6ypUsO2kvA35/MKG9F1uXYTuVJq0TCkC grAVym4+KUR0LB27ZfQ4t3/cXXu46fHKZdu7TBQ4iDszI9pHp1U9cIjZiyUXfNhZKU Hf8/SKalqo6NAoTiaeI8fRbl8RB5B4tggqwo1TorWPnyqQGjzW2/VTIGUYrKBfMIjj 2hJ2bT5zfZAaQ== Subject: Re: [PATCH net-next v4 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: Mon, 30 Nov 2026 03:48:34 +0000 Message-ID: <179601051449.3146.7267005649784031183@kernel.org> In-Reply-To: <20261129034652.1853485-12-omar@blockcast.net> References: <20261129034652.1853485-12-omar@blockcast.net> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@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: 1 · Low: 2 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, disc_answer() can report "no reply" for a capture that never started. - [Low] In setup_links() in tools/testing/selftests/net/amt_v6.sh, the comment says "(amtr is NOARP and skips DAD on its own.)". - [Low] Concern: setup_topology() calls `slowwait 5 test -S "$SMCDIR/sock"` while `set -E` and `trap 'setup_fail $LINENO' ERR` are… -- 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 gateways and the relay talk to each other over an IPv6 outer link. It checks: - discovery through a secondary relay address - IPv4 and IPv6 multicast forwarding - the per-/64 tunnel cap - tunnel MTU handling - that a Discovery sent to ff02::1 gets no answer - gateway 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..923c2b374ce53 > --- /dev/null > +++ b/tools/testing/selftests/net/amt_v6.sh > @@ -0,0 +1,469 @@ [ ... ] > +setup_links() > +{ > + local ns > + > + # No DAD: the global addresses of the gateway and relay links must > + # not be tentative, or the gateways could neither bind to them nor > + # send from them. (amtr is NOARP and skips DAD on its own.) [Severity: Low] Is the "amtr is NOARP" part of this comment accurate? amt_link_setup() in drivers/net/amt.c does set IFF_NOARP, but it calls ether_setup() last: drivers/net/amt.c:amt_link_setup() { ... dev->type = ARPHRD_NONE; dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST; ... ether_setup(dev); } ether_setup() always sets dev->type = ARPHRD_ETHER and dev->flags = IFF_BROADCAST|IFF_MULTICAST. That means amtr ends up without IFF_NOARP and goes through normal DAD. The test still works because $RELAY is in the accept_dad=0 loop below, and amtr is created after default.accept_dad=0 is set. Could the note in parentheses be fixed or removed? Otherwise someone may drop $RELAY from the loop because of it. > + for ns in "$LISTENER" "$GATEWAY" "$GATEWAY2" "$RELAY" "$SOURCE"; do > + ip netns exec "$ns" sysctl -wq \ > + net.ipv6.conf.all.accept_dad=0 \ > + net.ipv6.conf.default.accept_dad=0 > + done [ ... ] > + SMCDIR=$(mktemp -d) > + ip netns exec "$RELAY" smcrouted -P "$SMCDIR/pid" -u "$SMCDIR/sock" > + slowwait 5 test -S "$SMCDIR/sock" [Severity: Low] Can the inherited ERR trap fire inside this slowwait? setup_topology() runs with errtrace on and the setup_fail ERR trap installed: set -E trap 'setup_fail $LINENO' ERR ... setup_topology loopy_wait() in lib.sh runs the polled command inside a command substitution: if out=$("$@"); then With set -E, command substitutions inherit the ERR trap. smcrouted daemonizes before it creates its socket, so the first test -S calls can fail. If the trap fires there, setup_fail prints "FAIL: setup failed at line N" to stderr. Its exit only leaves the substitution subshell, so setup goes on and the run can still pass. Bash may suppress this, because the substitution is the condition of an if and the ignore-return state may carry into the subshell. If so, nothing is printed. Has this been checked against the bash versions used in CI, so the output does not show stray FAIL lines? > + 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; it is gone > + # before that only if it failed to start. > + for i in $(seq 50); do > + grep -q "listening on" "$cap" && break > + if ! kill -0 "$pid" 2> /dev/null; then > + wait "$pid" > + rm -f "$cap" > + return 2 > + fi > + sleep 0.1 > + done > + rm -f "$cap" [Severity: Medium] What happens if tcpdump is still running but has not printed "listening on" after all 50 tries? The loop just ends without returning 2. The sends then go ahead as if the capture were armed. The 6 second timeout started when tcpdump was launched. After about 5 seconds of polling, only about 1 second is left. The three sends below take at least 1.5 seconds, so timeout can kill tcpdump before or during them. The status handling then gives: wait "$pid" case $? in 0) return "${rc:-0}" ;; 124) return "${rc:-1}" ;; wait returns 124, rc is unset, and disc_answer() returns 1. That is the same status as a real "no reply". test_mcast_discovery() treats 1 as a pass for the ff02::1 check: disc_answer ff02::1 "udp and src port 2268 and dst port 40000" [ $? -eq 1 ] The ff02::1 check can therefore pass even though no capture covered the sends. The earlier unicast control ran its own tcpdump, so it does not show that this one worked. This also seems to contradict the function comment ("2 if the harness failed: tcpdump did not start") and the commit message: The ff02::1 check accepts only "no reply", so a broken capture cannot pass it. Should disc_answer() kill tcpdump and return 2 when the loop ends without seeing "listening on"? Starting the capture deadline only once tcpdump is listening may also help. > + # Type 1 (Relay Discovery), version 0, then a nonce. > + for i in 1 2 3; do > + printf '\x01\x00\x00\x00\x12\x34\x56\x78' | > + ip netns exec "$GATEWAY" socat -u - \ > + "$to,so-bindtodevice=gw_relay" || rc=2 > + sleep 0.5 > + done [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261129034652.1853485-1-omar%40blockcast.net