[LTP] [PATCH v2 1/2] tst_net.sh: Detect IPv6 disabled via sysct
Petr Vorel
pvorel@suse.cz
Thu Mar 23 06:17:35 CET 2023
Hi Cyril,
> 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
Well, bug from 2008 (fixed in svn, probably that year). But I agree that
it's better to get rid of sysctl. I'll use cat here and prepare fix for the rest
of tst_net.sh sysctl usage.
Kind regards,
Petr
More information about the ltp
mailing list