]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ip: netconf: fix overzealous error checking
authorJakub Kicinski <kuba@kernel.org>
Wed, 9 Oct 2024 18:21:54 +0000 (11:21 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 11 Oct 2024 17:35:58 +0000 (10:35 -0700)
commit6887a0656dad7bb826deea6242f4d7462ee96014
treef934b169475b1f69dae79ed985c611b5d77e4fc2
parentf305296e40c5a5b40d5af6f47f3f0e669e52e604
ip: netconf: fix overzealous error checking

The rtnetlink.sh kernel test started reporting errors after
iproute2 update. The error checking introduced by commit
under fixes is incorrect. rtnl_listen() always returns
an error, because the only way to break the loop is to
return an error from the handler, it seems.

Switch this code to using normal rtnl_talk(), instead of
the rtnl_listen() abuse. As far as I can tell the use of
rtnl_listen() was to make get and dump use common handling
but that's no longer the case, anyway.

Before:
  $ ip -6 netconf show dev lo
  inet6 lo forwarding off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off
  $ echo $?
  2

After:
  $ ./ip/ip -6 netconf show dev lo
inet6 lo forwarding off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off
  $ echo $?
  0

Fixes: 00e8a64dac3b ("ip: detect errors in netconf monitor mode")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ipnetconf.c