Skip to content

Commit 3a08208

Browse files
liuhangbinPaolo Abeni
authored andcommitted
selftests: forwarding: lib: quote the sysctl values
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: f5ae577 ("selftests: forwarding: lib: Add sysctl_set(), sysctl_restore()") Signed-off-by: Hangbin Liu <[email protected]> Reviewed-by: Petr Machata <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 2fcde9f commit 3a08208

File tree

1 file changed

+2
-2
lines changed
  • tools/testing/selftests/net/forwarding

1 file changed

+2
-2
lines changed

tools/testing/selftests/net/forwarding/lib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,14 +914,14 @@ sysctl_set()
914914
local value=$1; shift
915915

916916
SYSCTL_ORIG[$key]=$(sysctl -n $key)
917-
sysctl -qw $key=$value
917+
sysctl -qw $key="$value"
918918
}
919919

920920
sysctl_restore()
921921
{
922922
local key=$1; shift
923923

924-
sysctl -qw $key=${SYSCTL_ORIG["$key"]}
924+
sysctl -qw $key="${SYSCTL_ORIG[$key]}"
925925
}
926926

927927
forwarding_enable()

0 commit comments

Comments
 (0)