From: Benjamin Poirier <bpoirier@nvidia.com>
To: netdev@vger.kernel.org
Cc: David Ahern <dsahern@kernel.org>,
Stephen Hemminger <stephen@networkplumber.org>,
Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH iproute2 3/4] ip-monitor: Include stats events in default and "all" cases
Date: Thu, 22 Sep 2022 15:19:37 +0900 [thread overview]
Message-ID: <20220922061938.202705-4-bpoirier@nvidia.com> (raw)
In-Reply-To: <20220922061938.202705-1-bpoirier@nvidia.com>
It seems that stats were omitted from `ip monitor` and `ip monitor all`.
Since all other event types are included, include stats as well. Use the
same logic as for nexthops.
Fixes: a05a27c07cbf ("ipmonitor: Add monitoring support for stats events")
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
---
ip/ipmonitor.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
index 380ab526..cb2195d1 100644
--- a/ip/ipmonitor.c
+++ b/ip/ipmonitor.c
@@ -180,6 +180,7 @@ static int accept_msg(struct rtnl_ctrl_data *ctrl,
int do_ipmonitor(int argc, char **argv)
{
+ int lstats = 0, stats_set = 1;
int lnexthop = 0, nh_set = 1;
char *file = NULL;
unsigned int groups = 0;
@@ -190,7 +191,6 @@ int do_ipmonitor(int argc, char **argv)
int lprefix = 0;
int lneigh = 0;
int lnetconf = 0;
- int lstats = 0;
int lrule = 0;
int lnsid = 0;
int ifindex = 0;
@@ -224,41 +224,51 @@ int do_ipmonitor(int argc, char **argv)
llink = 1;
groups = 0;
nh_set = 0;
+ stats_set = 0;
} else if (matches(*argv, "address") == 0) {
laddr = 1;
groups = 0;
nh_set = 0;
+ stats_set = 0;
} else if (matches(*argv, "route") == 0) {
lroute = 1;
groups = 0;
nh_set = 0;
+ stats_set = 0;
} else if (matches(*argv, "mroute") == 0) {
lmroute = 1;
groups = 0;
nh_set = 0;
+ stats_set = 0;
} else if (matches(*argv, "prefix") == 0) {
lprefix = 1;
groups = 0;
nh_set = 0;
+ stats_set = 0;
} else if (matches(*argv, "neigh") == 0) {
lneigh = 1;
groups = 0;
nh_set = 0;
+ stats_set = 0;
} else if (matches(*argv, "netconf") == 0) {
lnetconf = 1;
groups = 0;
nh_set = 0;
+ stats_set = 0;
} else if (matches(*argv, "rule") == 0) {
lrule = 1;
groups = 0;
nh_set = 0;
+ stats_set = 0;
} else if (matches(*argv, "nsid") == 0) {
lnsid = 1;
groups = 0;
nh_set = 0;
+ stats_set = 0;
} else if (matches(*argv, "nexthop") == 0) {
lnexthop = 1;
groups = 0;
+ stats_set = 0;
} else if (strcmp(*argv, "stats") == 0) {
lstats = 1;
groups = 0;
@@ -336,6 +346,8 @@ int do_ipmonitor(int argc, char **argv)
}
if (nh_set)
lnexthop = 1;
+ if (stats_set)
+ lstats = 1;
if (file) {
FILE *fp;
--
2.37.2
next prev parent reply other threads:[~2022-09-22 6:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-22 6:19 [PATCH iproute2 0/4] monitor command fixes Benjamin Poirier
2022-09-22 6:19 ` [PATCH iproute2 1/4] bridge: Do not print stray prefixes in monitor mode Benjamin Poirier
2022-09-22 15:28 ` Stephen Hemminger
2022-10-25 22:29 ` [PATCH iproute2] ip-monitor: Do not error out when RTNLGRP_STATS is not available Benjamin Poirier
2022-10-26 2:17 ` Stephen Hemminger
2022-10-26 3:20 ` Stephen Hemminger
2022-10-26 6:49 ` [PATCH iproute2 v2] " Benjamin Poirier
2022-09-22 6:19 ` [PATCH iproute2 2/4] ip-monitor: Do not listen for nexthops by default when specifying stats Benjamin Poirier
2022-09-22 6:19 ` Benjamin Poirier [this message]
2022-10-25 15:51 ` [PATCH iproute2 3/4] ip-monitor: Include stats events in default and "all" cases Stephen Hemminger
2022-09-22 6:19 ` [PATCH iproute2 4/4] ip-monitor: Fix the selection of rtnl groups when listening for all object types Benjamin Poirier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220922061938.202705-4-bpoirier@nvidia.com \
--to=bpoirier@nvidia.com \
--cc=dsahern@kernel.org \
--cc=idosch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.