[LTP] [PATCH v2 1/2] tst_net.sh: Detect IPv6 disabled via sysct

Cyril Hrubis chrubis@suse.cz
Wed Mar 22 17:35:46 CET 2023


Hi!
> No, but we already use sysctl in tst_init_iface():
> sysctl -qw net.ipv6.conf.$iface.accept_dad=0 || return $?
> tst_rhost_run -c "sysctl -qw net.ipv6.conf.$iface.accept_dad=0" || return $?
>
> and we don't check for sysctl (expecting is everywhere). I'd also allow using
> sysctl (and then add a check via tst_require_cmds) or change also these with
> cat for reading and echo ... > for writing. WDYT?

I would say that sysctl is useful when you have a config file with a
bunch of values to be changed, but I would avoid using it in scripts,
because all it does in that cases to perepend the proc part of the path
and converts dots into slashes. And sometimes, when a path component
contains a dot, it fails to replace the right dots into slashes too:

http://lists.busybox.net/pipermail/busybox-cvs/2008-October/028382.html

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list