OSDN Git Service

selftests: mptcp: declare var as local
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Wed, 30 Nov 2022 14:06:27 +0000 (15:06 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 2 Dec 2022 04:06:06 +0000 (20:06 -0800)
commit5f17f8e315ad77c7ba45afe169b4598efd5d5bc3
tree57f5eec9c958c7f35ad40b629eba2590e3544379
parentde2392028a19e6841cd0ef14b9c832a7a2bc3a69
selftests: mptcp: declare var as local

Just to avoid classical Bash pitfall where variables are accidentally
overridden by other functions because the proper scope has not been
defined.

That's also what is done in other MPTCP selftests scripts where all non
local variables are defined at the beginning of the script and the
others are defined with the "local" keyword.

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_sockopt.sh