From: David Ahern <dsahern@kernel.org>
To: netdev@vger.kernel.org
Cc: stephen@networkplumber.org, christian@brauner.io,
David Ahern <dsahern@gmail.com>
Subject: [PATCH iproute2-next 11/11] libnetlink: Rename rtnl_wilddump_stats_req_filter to rtnl_statsdump_req_filter
Date: Sat, 29 Sep 2018 10:59:31 -0700 [thread overview]
Message-ID: <20180929175931.18448-12-dsahern@kernel.org> (raw)
In-Reply-To: <20180929175931.18448-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
rtnl_wilddump_stats_req_filter only takes RTM_GETSTATS as the type argument
so rename to rtnl_statsdump_req_filter for consistency with other request
functions and hardcode the type argument.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
bridge/vlan.c | 8 ++------
include/libnetlink.h | 3 +--
ip/iplink.c | 4 +---
ip/iplink_xstats.c | 4 +---
lib/libnetlink.c | 5 ++---
misc/ifstat.c | 4 ++--
6 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/bridge/vlan.c b/bridge/vlan.c
index 59ed1964bcd2..239907bdad89 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -603,9 +603,7 @@ static int vlan_show(int argc, char **argv)
__u32 filt_mask;
filt_mask = IFLA_STATS_FILTER_BIT(IFLA_STATS_LINK_XSTATS);
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC,
- RTM_GETSTATS,
- filt_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) {
perror("Cannont send dump request");
exit(1);
}
@@ -619,9 +617,7 @@ static int vlan_show(int argc, char **argv)
}
filt_mask = IFLA_STATS_FILTER_BIT(IFLA_STATS_LINK_XSTATS_SLAVE);
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC,
- RTM_GETSTATS,
- filt_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) {
perror("Cannont send slave dump request");
exit(1);
}
diff --git a/include/libnetlink.h b/include/libnetlink.h
index 29eb906ec9eb..8655e0b75c38 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -76,8 +76,7 @@ typedef int (*req_filter_fn_t)(struct nlmsghdr *nlh, int reqlen);
int rtnl_linkdump_req_filter_fn(struct rtnl_handle *rth, int fam,
req_filter_fn_t fn)
__attribute__((warn_unused_result));
-int rtnl_wilddump_stats_req_filter(struct rtnl_handle *rth, int fam, int type,
- __u32 filt_mask)
+int rtnl_statsdump_req_filter(struct rtnl_handle *rth, int fam, __u32 filt_mask)
__attribute__((warn_unused_result));
int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req,
int len)
diff --git a/ip/iplink.c b/ip/iplink.c
index d99c49ed244a..50ccb49a0263 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -1601,9 +1601,7 @@ static int iplink_afstats(int argc, char **argv)
}
}
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC,
- RTM_GETSTATS,
- filt_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) {
perror("Cannont send dump request");
return 1;
}
diff --git a/ip/iplink_xstats.c b/ip/iplink_xstats.c
index 10f953bc4584..908d9228369f 100644
--- a/ip/iplink_xstats.c
+++ b/ip/iplink_xstats.c
@@ -65,9 +65,7 @@ int iplink_ifla_xstats(int argc, char **argv)
else
filt_mask = IFLA_STATS_FILTER_BIT(IFLA_STATS_LINK_XSTATS);
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC,
- RTM_GETSTATS,
- filt_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC, filt_mask) < 0) {
perror("Cannont send dump request");
return -1;
}
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index bc72272be9c4..e12ce63bd05a 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -400,8 +400,7 @@ int rtnl_linkdump_req_filter_fn(struct rtnl_handle *rth, int family,
return send(rth->fd, &req, req.nlh.nlmsg_len, 0);
}
-int rtnl_wilddump_stats_req_filter(struct rtnl_handle *rth, int fam, int type,
- __u32 filt_mask)
+int rtnl_statsdump_req_filter(struct rtnl_handle *rth, int fam, __u32 filt_mask)
{
struct {
struct nlmsghdr nlh;
@@ -410,7 +409,7 @@ int rtnl_wilddump_stats_req_filter(struct rtnl_handle *rth, int fam, int type,
memset(&req, 0, sizeof(req));
req.nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct if_stats_msg));
- req.nlh.nlmsg_type = type;
+ req.nlh.nlmsg_type = RTM_GETSTATS;
req.nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST;
req.nlh.nlmsg_pid = 0;
req.nlh.nlmsg_seq = rth->dump = ++rth->seq;
diff --git a/misc/ifstat.c b/misc/ifstat.c
index 36eba605d5ba..f12c88f295c3 100644
--- a/misc/ifstat.c
+++ b/misc/ifstat.c
@@ -203,8 +203,8 @@ static void load_info(void)
if (is_extended) {
ll_init_map(&rth);
filter_mask = IFLA_STATS_FILTER_BIT(filter_type);
- if (rtnl_wilddump_stats_req_filter(&rth, AF_UNSPEC, RTM_GETSTATS,
- filter_mask) < 0) {
+ if (rtnl_statsdump_req_filter(&rth, AF_UNSPEC,
+ filter_mask) < 0) {
perror("Cannot send dump request");
exit(1);
}
--
2.11.0
next prev parent reply other threads:[~2018-09-30 0:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-29 17:59 [PATCH iproute2-next 00/11] Fix dump requests to use proper header for type David Ahern
2018-09-29 17:59 ` [PATCH iproute2-next 01/11] libnetlink: Convert GETADDR dumps to use rtnl_addrdump_req David Ahern
2018-09-30 9:35 ` Stephen Hemminger
2018-09-30 15:37 ` David Ahern
2018-09-29 17:59 ` [PATCH iproute2-next 02/11] libnetlink: Convert GETROUTE dumps to use rtnl_routedump_req David Ahern
2018-09-29 17:59 ` [PATCH iproute2-next 03/11] libnetlink: Convert GETADDRLABEL dumps to use rtnl_addrlbldump_req David Ahern
2018-09-29 17:59 ` [PATCH iproute2-next 04/11] libnetlink: Convert GETMDB dumps to use rtnl_mdbdump_req David Ahern
2018-09-29 17:59 ` [PATCH iproute2-next 05/11] libnetlink: Convert GETNETCONF dumps to use rtnl_netconfdump_req David Ahern
2018-09-29 17:59 ` [PATCH iproute2-next 06/11] libnetlink: Convert GETRULE dumps to use rtnl_ruledump_req David Ahern
2018-09-29 17:59 ` [PATCH iproute2-next 07/11] libnetlink: Convert GETNEIGH dumps to use rtnl_neighdump_req David Ahern
2018-09-29 17:59 ` [PATCH iproute2-next 08/11] libnetlink: Convert GETNEIGHTBL dumps to use rtnl_neightbldump_req David Ahern
2018-09-29 17:59 ` [PATCH iproute2-next 09/11] libnetlink: Convert GETNSID dumps to use rtnl_nsiddump_req David Ahern
2018-09-29 17:59 ` [PATCH iproute2-next 10/11] libnetlink: Rename rtnl_wilddump_* to rtnl_linkdump_* David Ahern
2018-09-29 17:59 ` David Ahern [this message]
2018-09-30 18:45 ` [PATCH iproute2-next 00/11] Fix dump requests to use proper header for type Christian Brauner
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=20180929175931.18448-12-dsahern@kernel.org \
--to=dsahern@kernel.org \
--cc=christian@brauner.io \
--cc=dsahern@gmail.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.