Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp168995lqr; Wed, 5 Jun 2024 02:23:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWTnFt0FzAzJRzr/yeQebvlI8DpbwFoOKIOkvv8GNn2+Ej5SjC/MX98+2ilpZEQBzH3pG1pDUpxR1lupYbujl3LuCMIwOWoiQxDbWOAtA== X-Google-Smtp-Source: AGHT+IFk58kLw7W0W1lScMK6UvCbTQbgvOuyFCaURIt8jd1iuAJL9S9qPBIY0J91IqpcAIBFVyOg X-Received: by 2002:ac8:5e08:0:b0:43d:f612:979e with SMTP id d75a77b69052e-4402b66b85cmr17865321cf.47.1717579432877; Wed, 05 Jun 2024 02:23:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717579432; cv=pass; d=google.com; s=arc-20160816; b=NCCla/uyMD8z6ACNrB5guyPhLIBosLG53jj9fk8FJtMsh3vIbx73nMsh/v30w3coUj 2MBY/I9+i5nUlGgGkvRd5SZy6E06ENMIXtTY+SPr9hPqgCynRs1jKcAbYsip04Nqs8p5 fhNywIIrYIalqQE6vrr6xQuqlDO0yqHUzafXF/Si8pK3oi2IG4Wgek/4Nrq5Dw+6pxYG kSh7JHe/lD1I5zjrrqkuQXJrRH775vyB9l8Atvc3sEP1upXpzSGmWm5qsGYotnk4yzkv 5gtg3Vk2eiCHTyBSiPt1caJ4jPHt4gVXpGekt2lFE4q96EDriLd7nkjCWZKhQeAoh1Nw wlVw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=AmcXemuYjpQ1N+9eRl2mzQG5R4f9ZcpzFopST2vzVRU=; fh=FIPDDvcut+x+nBN3CwVRT9c9/DpVJ9+o8gFXtr0DKU4=; b=1HIUpBHNKC3B6gU837qI312wMJo9bBqMewqpzXL3WB7QHSOdzWOHY6jrfezBW4yFxV 0RfF8uKWd8BTMep+FCkvtqnJbOkR8DCKAhbXYX6uEfweHi40pATKUDId1dyt6233qDWn H3/57tB3aDycuvRu6v7tKUimrJXqJo9ylsmvG/ijMek7BOBJZ5Zn7l6gwcaA9/BnkLwN 7bndImjqbR6akKXDFx4iR58znBBHC2TTSfEUmH6LScVifh6NQ53/hzZ9cHoZUCIvwvUS i5PAi2pYi49AVKjPr6RVfRjR2YPXqpLP4zmQYlBi3kIhfl6LSo4yQN9v+NSoOnK76Qjy 2vlg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tATS6KKm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202086-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202086-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43ff259e21asi38513341cf.659.2024.06.05.02.23.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 02:23:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202086-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tATS6KKm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202086-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202086-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8DEDD1C21E69 for ; Wed, 5 Jun 2024 09:23:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F0EC1922F8; Wed, 5 Jun 2024 09:21:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tATS6KKm" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A93111922D2; Wed, 5 Jun 2024 09:21:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717579317; cv=none; b=tz9vY0W8wLb01v/hBEaKKOGVuqB1VDRsJGuTzRaRD4tz2jpqBjwTba9MCK6G61v2mp8a792N/WIttJof0OB+eZoOXaA5Oc8CCrE5x/Gtvlfek8UBVas+q5O1JLrIW9JaYcMgNg2/wgF6UkyQFF2wsL+FjKDAll2iMj92SNnpa4E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717579317; c=relaxed/simple; bh=8P3FRjsCJEzDXjJHU+ebT7e/zra1DAmqDTABQdJrGvg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=atirvqcldcwHAsU4O30GPDYQjf9e7Ypc2ysEmqBqNNwm/OO0jUlOiFq2T1d8NtWmDddySKN1KhwwFGGNhDJ6SrX4GN0VOIPc81lzzqHH4KjKvJx6pioEpkoaCEYAOF2n+cJVhViGSBp87Km48RdXvRzRjvibMbexE1HGUwiqAhk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tATS6KKm; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22CBFC32781; Wed, 5 Jun 2024 09:21:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717579317; bh=8P3FRjsCJEzDXjJHU+ebT7e/zra1DAmqDTABQdJrGvg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=tATS6KKmR+QkxjIT2Wsql1HRYBVZocSUE/m++vf3bWsXWw+VgFSQ99GDgzG3y41pJ FtmMaENxUp3Yr5mjOcRM2C3e2dlU93M0fNMzfD/I08cNWyVQVsMK7XSmdW09FGby8S u+0uIq+5gqgcvZhWkkC6zrn/hRHwM39OerV9bFRBsIqdSXvnRLpC2YB+7mLh8XfLT4 FOxIhgAUgwrVnSS+MwsLM2yafmH3/yPHdMWFugTr3OHuXFKmRjpgKaMXsPswX17fTX gL0lSPLpYr5e0N/wdAMdENVE6qMWd1Axzm+hclOWc4jWhBn0dJUbBF4GtwTB9F3R99 joqeaV0razKig== From: "Matthieu Baerts (NGI0)" Date: Wed, 05 Jun 2024 11:21:18 +0200 Subject: [PATCH net 3/3] selftests: net: lib: set 'i' as local Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240605-upstream-net-20240605-selftests-net-lib-fixes-v1-3-b3afadd368c9@kernel.org> References: <20240605-upstream-net-20240605-selftests-net-lib-fixes-v1-0-b3afadd368c9@kernel.org> In-Reply-To: <20240605-upstream-net-20240605-selftests-net-lib-fixes-v1-0-b3afadd368c9@kernel.org> To: mptcp@lists.linux.dev, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Petr Machata , Hangbin Liu Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" , Geliang Tang X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1157; i=matttbe@kernel.org; h=from:subject:message-id; bh=8P3FRjsCJEzDXjJHU+ebT7e/zra1DAmqDTABQdJrGvg=; b=kA0DAAgB9reCT0JpoHMByyZiAGZgLiehkfETklVcL6kiyeMZ25HVrqQyKurMNJfqTMuViABsq IkCMwQAAQgAHRYhBOjLhfdodwV6bif3eva3gk9CaaBzBQJmYC4nAAoJEPa3gk9CaaBztswP/AsM NFpBCj+QO3MUO5BAadFkNCsQXfDciG9ZoOUlQf0mnjcbK90K82iStHfA9uqQPInYWcECTl68/kD 7Y91s96zW2ibzCS+FPgpJbuHyZCIYKEUT4I5kdsBgI1MiidWIROdY0Rc/scGgydeMhUWP2+Xmfy 9ohF/+filwHnTCRyEeY95SCrJAi2BmGyz5q+oGpebZBfpaLLUjiWfThJbBGlQ+ZEalESJs2jhIQ QYa+fzDW+h/A87Q9nTjCxtCV/Jm+buo6Q/nNHfGdOJLiPwdNOprRGgxxJNzfb/jq5KG6xNNy3eB JIgrw81Xva5cqigPxgqDXicqd0NaDLKnjJf77zNmPUaPAy0slrpULXQyj7gW9bCSXdJQY+D4vyV XCYJdvtNZvV2abzJ6pw/xYGJj5xePTmqiOaI/AycmWw1jGe4smPe9lfkdXxNRnUyNF6GEdOdWM1 229SXuw1TL86hEbV3ZtKfVV5w0+jc3vOkN+K7uABdHSqp8Kjs6UmJJmDk9btKNBiaBmIVw97QJY GFdHTHu2CZjmDGL2Um9NfxRvhHczrLdnn7UPDLJYfTOGzySPNibGYnV6/Pu6VPHgSZ6PZJGiQx1 kXsDvE+SWvUjxy2b4KhLF9mO+VHUZN7i/UHXYmtzqQWomyx9YdZQ8Uq8HQ97pfoiqsdYAvOWsLn /miyX X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Without this, the 'i' variable declared before could be overridden by accident, e.g. for i in "${@}"; do __ksft_status_merge "${i}" ## 'i' has been modified foo "${i}" ## using 'i' with an unexpected value done After a quick look, it looks like 'i' is currently not used after having been modified in __ksft_status_merge(), but still, better be safe than sorry. I saw this while modifying the same file, not because I suspected an issue somewhere. Fixes: 596c8819cb78 ("selftests: forwarding: Have RET track kselftest framework constants") Acked-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/lib.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/net/lib.sh b/tools/testing/selftests/net/lib.sh index e2f51102d7e1..9155c914c064 100644 --- a/tools/testing/selftests/net/lib.sh +++ b/tools/testing/selftests/net/lib.sh @@ -27,6 +27,7 @@ __ksft_status_merge() local -A weights local weight=0 + local i for i in "$@"; do weights[$i]=$((weight++)) done -- 2.43.0