lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKiXHKcLsEWbEz1EkzE942PbsMEpfj=wO7uYDb+Nxy8nGCEx1Q@mail.gmail.com>
Date: Thu, 21 Aug 2025 10:45:19 +0200
From: Alessandro <alessandro@...5c.net>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: Alessandro Ratti <alessandro@...5c.net>, davem@...emloft.net, edumazet@...gle.com, 
	kuba@...nel.org, pabeni@...hat.com, skhan@...uxfoundation.org, 
	netdev@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH] selftests: rtnetlink: add checks for ifconfig and iproute2

On Thu, 21 Aug 2025 at 10:25, Hangbin Liu <liuhangbin@...il.com> wrote:
>
> On Thu, Aug 21, 2025 at 09:43:11AM +0200, Alessandro Ratti wrote:
> > On systems where `ifconfig` is not available (e.g., modern Debian), the
> > `kci_test_promote_secondaries` test fails. Wrap the call in a check.
> >
> > Additionally, `do_test_address_proto` fails on iproute2 versions that
> > lack support for `proto` in `ip address` commands. Add a minimal feature
> > check and skip the test with a proper message if unsupported.
> >
> > These changes allow the tests to run and report SKIP instead of FAIL on
> > platforms with older tools.
> >
> > Signed-off-by: Alessandro Ratti <alessandro@...5c.net>
> > ---
> >  tools/testing/selftests/net/rtnetlink.sh | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh
> > index d6c00efeb664..9bff620ef595 100755
> > --- a/tools/testing/selftests/net/rtnetlink.sh
> > +++ b/tools/testing/selftests/net/rtnetlink.sh
> > @@ -330,7 +330,9 @@ kci_test_promote_secondaries()
> >       for i in $(seq 2 254);do
> >               IP="10.23.11.$i"
> >               ip -f inet addr add $IP/16 brd + dev "$devdummy"
> > -             ifconfig "$devdummy" $IP netmask 255.255.0.0
> > +             if command -v ifconfig >/dev/null 2>&1; then
> > +                     ifconfig "$devdummy" $IP netmask 255.255.0.0
> > +             fi
>
> Maybe just skip the promote_secondaries test if ifconfig is not available?
>

Thank you for your review and comment.

My takeaway here is that the test works because the IP addresses are set on the
$devdummy by the previous ip(8) command, and ifconfig seems a bit redundant.

Also, considering we are testing netlink, I was baffled to see ifconfig there
that, if I'm not mistaken, uses ioctl(); but I might be missing
something obvious
here, considering I'm looking at these tests for the first time, so bear with
me :)

If it's better to skip the test altogether when ifconfig is missing, I'll
submit another patch to do so.

Thank you

Best regards,
Alessandro

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ