summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorHangbin Liu <liuhangbin@gmail.com>2023-02-08 11:21:10 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-22 12:50:32 +0100
commit1aab663ecb78c225b19df97fddc33831b8c9944e (patch)
tree138fae441ab1140b282d8a5a9c4148fbcddc7b46 /tools
parentba38eacade35dd2316d77b37494e6e0c01bab595 (diff)
downloadlinux-stable-1aab663ecb78c225b19df97fddc33831b8c9944e.tar.gz
linux-stable-1aab663ecb78c225b19df97fddc33831b8c9944e.tar.bz2
linux-stable-1aab663ecb78c225b19df97fddc33831b8c9944e.zip
selftests: forwarding: lib: quote the sysctl values
[ Upstream commit 3a082086aa200852545cf15159213582c0c80eba ] When set/restore sysctl value, we should quote the value as some keys may have multi values, e.g. net.ipv4.ping_group_range Fixes: f5ae57784ba8 ("selftests: forwarding: lib: Add sysctl_set(), sysctl_restore()") Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Link: https://lore.kernel.org/r/20230208032110.879205-1-liuhangbin@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/net/forwarding/lib.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index f190ad58e00d..4d8845a68cf2 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -562,14 +562,14 @@ sysctl_set()
local value=$1; shift
SYSCTL_ORIG[$key]=$(sysctl -n $key)
- sysctl -qw $key=$value
+ sysctl -qw $key="$value"
}
sysctl_restore()
{
local key=$1; shift
- sysctl -qw $key=${SYSCTL_ORIG["$key"]}
+ sysctl -qw $key="${SYSCTL_ORIG[$key]}"
}
forwarding_enable()