From: Stephen Hemminger Date: Thu, 8 Feb 2024 17:23:07 +0000 (-0800) Subject: ip: detect errors in netconf monitor mode X-Git-Tag: v6.8.0~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00e8a64dac3be0203b149d3fe0307723ff76403e;p=thirdparty%2Fiproute2.git 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 --- diff --git a/ip/ipnetconf.c b/ip/ipnetconf.c index 9ae6c45e7..a0c7e051b 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: