@@ -100,23 +100,20 @@ tst_brk_()
[ -z "$TST_USE_LEGACY_API" ] && tst_brk $@ || tst_brkm $@
}
-# detect IPv6 not disabled via ipv6.disable=1 kernel cmdline parameter
-# or via CONFIG_IPV6=y kernel configure option
-# $TST_NET_IPV6_ENABLED: 1 (enabled), 0 (disabled)
+# Detect IPv6 disabled via ipv6.disable=1 kernel cmdline parameter
+# or via CONFIG_IPV6=y kernel configure option.
tst_net_detect_ipv6_cmdline()
{
local type="${1:-lhost}"
local cmd='[ -f /proc/net/if_inet6 ]'
- local ret
if [ "$type" = "lhost" ]; then
$cmd
else
tst_rhost_run -c "$cmd"
fi
- ret=$?
- if [ $ret -eq 0 ]; then
+ if [ $? -eq 0 ]; then
TST_NET_IPV6_ENABLED=1
else
TST_NET_IPV6_ENABLED=0
$? is enough in tst_net_detect_ipv6_cmdline(). Signed-off-by: Petr Vorel <pvorel@suse.cz> --- testcases/lib/tst_net.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)