[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240208172647.324168-2-stephen@networkplumber.org>
Date: Thu, 8 Feb 2024 09:26:28 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2 2/3] ip: detect errors in netconf monitor mode
If rtnl_listen() returns error while looking for netconf events,
then exit with status of 2 as other iproute2 monitor actions do.
Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
ip/ipnetconf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ip/ipnetconf.c b/ip/ipnetconf.c
index 9ae6c45e7fd1..a0c7e051bac5 100644
--- a/ip/ipnetconf.c
+++ b/ip/ipnetconf.c
@@ -193,7 +193,8 @@ static int do_show(int argc, char **argv)
perror("Can not send request");
exit(1);
}
- rtnl_listen(&rth, print_netconf, stdout);
+ if (rtnl_listen(&rth, print_netconf, stdout) < 0)
+ exit(2);
} else {
rth.flags = RTNL_HANDLE_F_SUPPRESS_NLERR;
dump:
--
2.43.0
Powered by blists - more mailing lists