From: David Ahern Date: Sat, 29 Sep 2018 17:12:59 +0000 (-0700) Subject: libnetlink: Rename rtnl_wilddump_stats_req_filter to rtnl_statsdump_req_filter X-Git-Tag: v4.20.0~101^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56eeeda9782193ed5abd6b29383b3c746d88a988;p=thirdparty%2Fiproute2.git libnetlink: Rename rtnl_wilddump_stats_req_filter to rtnl_statsdump_req_filter 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 --- diff --git a/bridge/vlan.c b/bridge/vlan.c index 59ed1964b..239907bda 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 410c441b9..8e411ebc0 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 d99c49ed2..50ccb49a0 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 10f953bc4..908d92283 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 73d720f4f..f8b8fbfd0 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 6e70e1eb1..3a0e780f7 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); }