Skip to content

Commit 105ea56

Browse files
liuhangbingregkh
authored andcommitted
selftests: forwarding: lib: quote the sysctl values
[ Upstream commit 3a08208 ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 528e3f3 commit 105ea56

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
@@ -817,14 +817,14 @@ sysctl_set()
817817
local value=$1; shift
818818

819819
SYSCTL_ORIG[$key]=$(sysctl -n $key)
820-
sysctl -qw $key=$value
820+
sysctl -qw $key="$value"
821821
}
822822

823823
sysctl_restore()
824824
{
825825
local key=$1; shift
826826

827-
sysctl -qw $key=${SYSCTL_ORIG["$key"]}
827+
sysctl -qw $key="${SYSCTL_ORIG[$key]}"
828828
}
829829

830830
forwarding_enable()

0 commit comments

Comments
 (0)