diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2024-02-08 09:23:07 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2024-02-08 09:23:07 -0800 |
commit | 00e8a64dac3be0203b149d3fe0307723ff76403e (patch) | |
tree | 600a32fc4e15657f5dc2924483b0b54adb455ff8 | |
parent | f4dc6a784f6e2cee091027434f05a501f4cc1411 (diff) | |
download | iproute2-00e8a64dac3be0203b149d3fe0307723ff76403e.tar.gz |
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@networkplumber.org>
-rw-r--r-- | ip/ipnetconf.c | 3 |
1 files changed, 2 insertions, 1 deletions
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: |