[LTP] [PATCH v3 1/3] tst_net.sh: Fix for disabled IPv6

Cyril Hrubis chrubis@suse.cz
Tue May 10 15:21:55 CEST 2022


Hi!
> diff --git testcases/lib/tst_net.sh testcases/lib/tst_net.sh
> index 29d80df89..48dd6e8eb 100644
> --- testcases/lib/tst_net.sh
> +++ testcases/lib/tst_net.sh
> @@ -1008,7 +1008,7 @@ if [ -z "$_tst_net_parse_variables" ]; then
>         eval $(tst_net_ip_prefix $IPV4_LHOST || echo "exit $?")
>         eval $(tst_net_ip_prefix -r $IPV4_RHOST || echo "exit $?")
> 
> -       tst_net_detect_ipv6 rhost
> +       [ "$TST_NET_IPV6_ENABLED" = 1 ] && tst_net_detect_ipv6 rhost

That solves the case where lhost does not support ipv6 but rhost does,
but there is still case where lhost does support it but rhost does not,
to fix that we have to clear TST_NET_IPV6_ENABLED in the
tst_net_detect_ipv6() as well.

	if [ $ret -eq 0 ]; then
		TST_NET_IPV6_ENABLED=1
	else
		TST_NET_IPV6_ENABLED=0
		tst_res TINFO "IPv6 disabled on $type"
	fi

>         if [ "$TST_NET_IPV6_ENABLED" = 1 ]; then
>                 eval $(tst_net_ip_prefix $IPV6_LHOST || echo "exit $?")
> 
> 

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list